Function: sumnumsidi
Section: sums
C-Name: sumnumsidi0
Prototype: V=GED1,L,p
Help: sumnumsidi(n=a,f,{safe=1}): numerical summation of f(n) from
 n = a to +infinity using Sidi summation; a must be an integer.
 If safe is set to 0, the function is faster but much less robust.
Wrapper: (,Gb)
Description:
  (gen,gen,?long):gen:prec sumnumsidi(${2 cookie}, ${2 wrapper}, $1, $3, $prec)
Doc: Numerical summation of $f(n)$ from $n=a$ to $+\infty$ using Sidi
 summation; $a$ must be an integer. The optional argument \kbd{safe}
 (set by default to $1$) can be set to $0$ for a faster but much less
 robust program; this is likely to lose accuracy when the sum is
 non-alternating.
 \bprog
 ? \pb3328
 ? z = zeta(2);
 ? exponent(sumnumsidi(n = 1, 1/n^2) - z)
 time = 1,507 ms.
 %2 = -3261 \\ already loses some decimals
 ? exponent(sumnumsidi(n = 1, 1/n^2, 0) - z)
 time = 442 ms. \\ unsafe is much faster
 %3 = -2108     \\ ... but very wrong

 ? l2 = log(2);
 ? exponent(sumnumsidi(n = 1,(-1)^(n-1)/n) - z)
 time = 718 ms.
 %5 = -3328 \\ not so slow and perfect
 ? exponent(sumnumsidi(n = 1,(-1)^(n-1)/n, 0) - z)
 time = 504 ms.
 %5 = -3328 \\ still perfect in unsafe mode, not so much faster
 @eprog
 \misctitle{Complexity} If the bitprecision is $b$, we try to achieve an
 absolute error less than $2^{-b}$. The function $f$ is evaluated at $O(b)$
 consecutive integer arguments at bit accuracy $1.56 b$ (resp.~$b$) in safe
 (resp.~unsafe) mode.
