digamma

Function digamma 

Source
pub fn digamma(z: &Expression) -> Expression
Expand description

Digamma function ψ(z) = Γ’(z)/Γ(z)

The digamma function is the logarithmic derivative of the Gamma function: ψ(z) = d/dz ln(Γ(z))

§Mathematical Properties

  • ψ(1) = -γ (Euler-Mascheroni constant ≈ -0.5772156649)
  • ψ(n+1) = ψ(n) + 1/n for positive integers n
  • ψ(z+1) = ψ(z) + 1/z (recurrence relation)
  • ψ(1/2) = -γ - ln(4)

§Implementation

Uses reflection formula for z < 0.5 and series expansion for z ≥ 0.5. Special values are computed exactly when possible.

§Arguments

  • z - Expression to evaluate digamma function at

§Examples

use mathhook_core::{Expression, Number};
use mathhook_core::functions::special::digamma;

let z = Expression::Number(Number::Integer(1));
let result = digamma(&z);