The Pi-Function

Our investigation of the extrapolation of 'piTangent' led us to a somewhat unexpected function Math. What about calling this function Math?

pi := proc(x) 4*Im(Psi(1/2 + 2^x * (1+I))) end:
'pi(x)'=pi(x);
seq(evalf(pi(x)),x=0..5);

Math

Math

plot([pi(x)],x=-12..12);

[Maple Plot]

The point is, why should we perform all these extrapolations on this function? All we have to do is to evaluate the function. To get a better approximation we just have to choose a larger argument. That's all. Lets look at the performance.

for i from 10 by 10 to 150 do print(i,evalf(pi(i)-Pi,100)) od;

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

Math

So increasing the argument by 10 gives us 6 more decimal digits of Math. What do we really need more than a fast way to calculate this function? We do can evaluate the function by a series.

piSer := proc(x)
4*sum(2^x/((n+1/2+2^x)^2+(2^x)^2),n=0..infinity) end:
seq(evalf(piSer(x)),x=0..5);

Math

pi(x)/4='sum(2^x/((n+1/2+2^x)^2+(2^x)^2),n=0..infinity)';

Math

This series eliminates all these frightening Mathand Mathand Math. Therefore I declare that henceforward the following definition should be used and the function called Math -function (the number theorists should call their functionpri , if they like).

'pi(x)' = 'sum(2^(x+2)/((n+1/2+2^x)^2+(2^x)^2),n=0..infinity)';

Math

Be sure that I do not mean that the right hand side should be used for numerical computation. Certainly there are more efficient ways to evaluate this function. If you know one, let me know! Clearly only solutions which do not assume Math are of value here.
Let's have a quick look at the asymptotics:

simplify(piSer(x));

Math

asympt(2*I*(Psi(1/2+x-I*x)-Psi(1/2+x+I*x)),x,20);
evalc(%); simplify(subs(x=2^x,%));

Math

Math

Math

How does Maple compute Math? Note the following bug in Maple V Release 5 (The limit is evaluated to 0 instead of Pi.)

limit(4*Im(Psi(1/2 + 2^x +2^x*I)),x=infinity);

Math