Probabilities::Lerch Function

double Lerch(const double z, double s, double a);

Lerch transcendent function.

#NameTypeDescription
1zconst doublebase of the geometric factor z^k; real, |z| <= 1.
2sdoubleexponent (order); real.
3adoubleoffset of the denominator; real, with a+k != 0 for k=0,1,2,....

Returns: 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.

Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler