Double digamma(Double x)
Returns the digamma function psi(x)=psi^((0))(x).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | x | Double | scalar |
Returns: Double
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