Two terms suffice to obtain 10 digits on $r>1$.
th3:=proc(q,N) local n;1+2*sum(q^(n^2),n=1..N);end:
th3d:=proc(q,N) local n;2*sum(n^2*q^(n^2),n=1..N);end:
alpha:=proc(r,N) local q,n; q:=exp(-Pi*r^(1/2));
(1/Pi)-4*r^(1/2)*th3d(-q,N)/th3(-q,N);"/th3(q,N)^4; end:
alphaf:=proc(s,n) local a; if s>1 then a:=alpha(s,n) else a:=sqrt(s)-s*alpha(1/s,n) fi;evalf(");end:
We may get a sense of $\alpha$Us lovely recursive properties from a [PLOT] on [0,10].
plota:=proc(a,b) local r;
print(plot(alphaf(r,2),r=a..b)); end:
#we need to get the plot to run with th piecewise definition cleanly
Lattice basis reduction allows us to illustrate the algbraic nature of $\alopha$ and indeed discover values:
readlib(lattice): Digits:=20;
minpoly(alphaf(2,3),3);
minpoly(alphaf(5,2),4); expand(subs(_X=1/2*5^(1/2)-1/2*(2*5^(1/2)-2)^(1/2),"));
Digits:=40;
minpoly(alphaf(27,2),6);
expand(subs(_X=3/2*3^(1/2)+3/2-3*2^(1/3),"));
#alpha(27) (takes too long for minpoly interactively?)