Function special::digamma
[−]
[src]
pub fn digamma(x: f64) -> f64
Compute the real-valued digamma function.
The digamma function is defined by
d ln(Γ(x))
ψ(x) = ----------
dx
where Γ is the Gamma function. The computation is based on an approximation as described in the reference below.
- M. J. Beal, “Variational Algorithms for Approximate Bayesian Inference.” The Gatsby Computational Neuroscience Unit, University College London, 2003, pp. 265–266.
Examples
use special::digamma; let euler_mascheroni = 0.5772156649015325; assert_eq!(-euler_mascheroni, digamma(1.0));