FLINT3.7.0-dev

arb_hypgeom_gamma_stirling_sum_horner, arb_hypgeom_gamma_stirling_sum_improved

Synopsis#include <flint/arb_hypgeom.h>
void arb_hypgeom_gamma_stirling_sum_horner(arb_t res, const arb_t z, slong N, slong prec)source
void arb_hypgeom_gamma_stirling_sum_improved(arb_t res, const arb_t z, slong N, slong K, slong prec)source

Sets res to the sum \sum_{n=1}^{N-1} B_{2n} / (2n(2n-1) z^{2n-1}) of the Stirling series for \log \Gamma(z), truncated before the term of index N. No bound for the truncation error is added.

arb_hypgeom_gamma_stirling_sum_horner uses Horner's scheme in 1/z^2, lowering the precision for the smaller terms. arb_hypgeom_gamma_stirling_sum_improved evaluates the first terms with exact Bernoulli numbers by rectangular splitting and rewrites the remaining terms, using B_{2n} = (-1)^{n+1} 2 (2n)! \zeta(2n) / (2\pi)^{2n} and \zeta(2n) = \sum_k k^{-2n}, as at most K polynomials in -1/(2\pi k z)^2 with integer coefficients plus a bounded remainder; K = 0 chooses the splitting parameter automatically. See Evaluating the sum.

Cite this page

The FLINT team, “arb_hypgeom_gamma_stirling_sum_horner, arb_hypgeom_gamma_stirling_sum_improved (arb_hypgeom.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/arb_hypgeom/arb_hypgeom_gamma_stirling_sum_horner.html (generated 2026-10-20).