Skip to main content

digamma_f64

Function digamma_f64 

Source
fn digamma_f64(x: f64) -> f64
Expand description

Compute digamma(x) using asymptotic expansion and recurrence.

For large x, use the asymptotic series: psi(x) ~ ln(x) - 1/(2x) - B_2/(2x^2) - B_4/(4x^4) - … where B_{2k} are Bernoulli numbers. For small x, use psi(x) = psi(x+1) - 1/x repeatedly.