Skip to main content

ln_gamma_half_ratio

Function ln_gamma_half_ratio 

fn ln_gamma_half_ratio(a: f64) -> f64
Expand description

ln Γ(a + ½) − ln Γ(a), stable at every a ≥ ½: a Lanczos difference below 20, above it the Stirling series written so the leading terms do not cancel, ½·ln a + a·ln(1 + 1/(2a)) − ½ + S(a + ½) − S(a), S(z) = 1/(12z) − 1/(360z³) + 1/(1260z⁵) − 1/(1680z⁷).

The generic body ln_gamma_half_ratio_in instantiated at f64: one Lanczos table and one summation order to maintain, so a coefficient correction cannot land in one copy and miss the other.