Probabilities.Lerch Method

Double Lerch(Double z, Double s, Double a)

Lerch transcendent function.

#NameDescription
1zbase of the geometric factor z^k
2real, |z| <= 1.
3sexponent (order)
4real.
5aoffset of the denominator
6real, with a+k != 0 for k=0,1,2,....

Returns: Double - an approximation to the Lerch transcendent function.

Remarks:

The Lerch transcendent is defined by the series

Phi(z,s,a) = sum_(k=0)^(inf)z^k/((a+k)^s) ,

estimated here by direct summation until the next term is below the relative tolerance 10^(-10). Terms with a+k=0a+k=0 are skipped. Special cases: Phi(1,s,1)=zeta(s) and Phi(z,1,1)=-ln(1-z)/z.

Domain: |z| <= 1 for convergence (the series converges geometrically for |z| < 1; at z=1 convergence requires s > 1 and is slow). Defined behavior: returns the partial sum; returns NAN when any argument is NAN.