Probabilities::digamma Function

double digamma(double x);

Returns the digamma function psi(x)=psi^((0))(x).

#NameTypeDescription
1xdouble
Remarks:

The digamma function is the first derivative of the logarithm of the Gamma function:

psi(x) = d/dxlnGamma(x) = Gamma'(x)/Gamma(x) .

It satisfies the recurrence psi(x+1)=psi(x)+1/x, the special values psi(1)=-gamma and psi(1/2)=-gamma-2ln 2, and is strictly increasing for x > 0.

Domain: x > 0. Defined behavior: returns NAN for x <= 0.

The algorithm was adapted from:

The algorithm "AS 103" from "Applied Statistics" (1976) VOL.25, NO.3 Available in Fortran at: http://lib.stat.cmu.edu/apstat/103

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