Double Lerch(Double z, Double s, Double a)
Lerch transcendent function.
| # | Name | Description |
|---|---|---|
| 1 | z | base of the geometric factor z^k |
| 2 | real, |z| <= 1. | |
| 3 | s | exponent (order) |
| 4 | real. | |
| 5 | a | offset of the denominator |
| 6 | real, 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 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.