Skip to main content

digamma

digamma (x)

The digamma function returns the digamma, or psi function of x. This is the logarithmic derivative of the gamma function:

Ψ(z)ddzln(Γ(z))=Γ(z)Γ(z).\displaystyle \Psi(z) \equiv \frac{d}{d z} \ln (\Gamma(z))=\frac{\Gamma^{\prime}(z)}{\Gamma(z)}.

In complex expressions, x is complex, and digamma(x) returns a complex value.

Limited testing indicates that the accuracy is approximately 1 part in 1016, at least for moderately-sized values of x.