Henri . Cohen on Sat, 13 Jan 2018 10:43:15 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Convergence Acceleration for Series


Hi,

First, write your function as
f(x)=exp(x*log(x)-x-lngamma(x+1))-1/sqrt(2*Pi*x)
otherwise you will often get overflow.
Second, notice that f(x) tends to 0 like C/n^{3/2}: thus
initialize a table by
tab=sumnummonieninit(1/2)
(the 1/2 is 3/2-1), and simply
sumnummonien(n=1,f(n),tab)
immediately gives the right answer.

Note that you cannot use directly the other acceleration methods
sumnum and sumnumap in this case because they try to evaluate
f(x) when |x| is huge, e.g., |x|>10^80. To use them, you could
modify the definition of f(x) by writing:
f(x)=if(abs(x)>10^20,asymptotic expansion,formula);

Best,

Henri Cohen