AngouriMath

Navigation

← Back to list of members

Polygamma​(PeterO.​Numbers.​EInteger,​AngouriMath.​Entity.​Number.​Complex)

 Method (no overloads)

Summary

The polygamma function psi^(n)(z), the (n + 1)-th derivative of ln Gamma(z), at the
working precision, for a whole n >= 0 and every complex z but its poles 0, -1, -2, ...,
where it is NaN. psi^(0) is the digamma function, Gamma'(z)/Gamma(z).

Remarks

Left of Re z = 1/2 it is reflected (DLMF 5.15.6),
psi^(n)(z) = (-1)^n psi^(n)(1 - z) - pi^(n + 1) Q_n(cot(pi z)), where Q_n is the polynomial
with d^n/dz^n cot(pi z) = pi^n Q_n(cot(pi z)): Q_0(c) = c and
Q_(k + 1)(c) = -(1 + c^2) Q_k'(c).
Right of it, the recurrence psi^(n)(z + 1) = psi^(n)(z) + (-1)^n n!/z^(n + 1) (DLMF 5.15.5) moves
the argument to Re w >= R, with R the working digits and n, where the asymptotic
series (DLMF 5.11.2 and 5.15.8) is summed until a term is below the working precision:
ln w - 1/(2 w) - sum B_(2k)/(2k w^(2k)) for the digamma function, and
(-1)^(n + 1) ((n - 1)!/w^n + n!/(2 w^(n + 1)) + sum B_(2k) (2k + n - 1)!/((2k)! w^(2k + n))) for
n >= 1. Its smallest term is about e^(-2 pi R) of the sum, so it converges well before
it diverges.
The Bernoulli numbers are exact, from the tangent numbers by Brent and Harvey's recurrence,
B_(2k) = (-1)^(k - 1) 2k T_k/(4^k (4^k - 1)), and cached.
https://github.com/asc-community/AngouriMath/issues/171

























Angouri © 2019-2026 · Project's repo · Site's repo · Octicons · Transparency · 4970 pages online