Sums of hypergeometric series with rational parameters
- Cost
- N terms at p bits — O(N) multiplications by small integers plus O(N^{1/2}) full multiplications by rectangular splitting; O(M(p) log² p) by binary splitting when the argument has O(1) bits.
Many special functions and constants reduce to partial sums
with small rational parameters , and a real argument of full precision: the error function (, ), the sine and cosine integrals ( and series and asymptotic series ), Bessel functions of rational order, and the incomplete gamma function. The functions arb_hypgeom_sum_fmpq_arb and arb_hypgeom_sum_fmpq_imag_arb of arb_hypgeom compute such sums exactly as written (no truncation error), with or . Their usage is described in Hypergeometric sums with rational parameters. In each term ratio
the numerator and denominator are products of small integers: the cost of the sum is dominated by the operations that involve the full-precision .
Forward recurrence#
arb_hypgeom_sum_fmpq_arb_forward keeps the partial sum as a fraction with an integer-valued ball : with and the integer numerator and denominator of the term ratio,
and a single division at the end. Each step costs one full multiplication by and multiplications by word-size integers when the products of the parameters fit in a word (otherwise by fmpz). This is the fastest method for a handful of terms.
Rectangular splitting#
The sum is evaluated backwards as a polynomial in with , after computing :
where each block is a polynomial of degree less than in with rational coefficients. Within a block, up to 8 consecutive term ratios are combined over a common denominator, so that the block is computed as one dot product of the powers of with exact integer coefficients (arb_dot_fmpz, with single-word products when the parameters are small) followed by one division by an integer; the multiplication by between blocks is the only full multiplication per block.
Input: the parameters, , , the precision .
Output: .
- ; compute (with the denominators of the parameters absorbed into ).
- ; for the indices in groups that do not cross multiples of and have at most 8 elements: compute the integer coefficients of the group over a common denominator, add their dot product with the corresponding powers of to , and divide by the integer denominator (the product of the lower-parameter factors of the group); when reaches a multiple of , multiply by .
- Return .
The cost is about full multiplications and multiplications and divisions of balls by small integers, which are linear in . When the terms decrease (for example and moderate), the blocks with small terms are computed at a precision reduced by the logarithm of their magnitude relative to the largest term, estimated in double precision from and the growth of . This method is due to Smith [Smi1989] and is analysed with these refinements in [Joh2014b; Joh2014c].
Binary splitting#
When itself has few bits, the matrix product form of Summation algorithms is computed as a product tree of exact (integer-valued) balls; arb_hypgeom_sum_fmpq_arb_bs puts into the numerators, or into the denominators if reciprocal is set. The cost is quasi-linear in the size of the result [Bre1976; CC1988]. The default choice uses binary splitting from 8192 bits when has at most bits.
Real and imaginary parts#
arb_hypgeom_sum_fmpq_imag_arb computes with real arithmetic: the even and odd terms form the real and imaginary parts, with signs and . The forward and rectangular splitting versions track the two parts separately (in rectangular splitting, the dot products take every second power of and coefficient). This saves the complex multiplications that acb arithmetic would perform. Binary splitting, where the leaves are cheap, uses complex balls with the factor in the leaf matrices.
Use in FLINT#
arb_hypgeom_sum_fmpq_arbandarb_hypgeom_sum_fmpq_imag_arbwith their_forward,_rsand_bsvariants.arb_hypgeom_siandarb_hypgeom_cisum their and series witharb_hypgeom_sum_fmpq_arband their asymptotic series witharb_hypgeom_sum_fmpq_imag_arb.- The special cases and with are implemented separately by
_arb_hypgeom_gamma_lower_sum_rs_1and_arb_hypgeom_gamma_upper_sum_rs_1for the error function. - Multiple-precision floating-point versions of hypergeometric binary splitting for constants are in
mp_real(see Floating-point arithmetic in FLINT).
Referenced from#
- Hypergeometric functions (algorithm)
- arb_hypgeom.h (module)
- Hypergeometric sums with rational parameters
References#
- [Smi1989] D. M. Smith. Efficient multiple-precision evaluation of elementary functions. Mathematics of Computation 52 (1989), 131–134. https://doi.org/10.1090/S0025-5718-1989-0971406-0
- [Joh2014b] F. Johansson, "Evaluating parametric holonomic sequences using rectangular splitting", ISSAC 2014, 256-263. https://doi.org/10.1145/2608628.2608629
- [Joh2014c] F. Johansson, "Efficient implementation of elementary functions in the medium-precision range", 22nd IEEE Symposium on Computer Arithmetic (ARITH 22), 83-89 (2015), https://arxiv.org/abs/1410.7176
- [Bre1976] R. P. Brent. The complexity of multiple-precision arithmetic. In R. S. Anderssen and R. P. Brent (eds.), The Complexity of Computational Problem Solving, University of Queensland Press, 1976, 126–165.
- [CC1988] D. V. Chudnovsky and G. V. Chudnovsky. Approximations and complex multiplication according to Ramanujan. In Ramanujan Revisited, Academic Press, 1988, 375–472.
The FLINT team, “Sums of hypergeometric series with rational parameters,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/algorithms/special-functions/hypergeometric-sums.html (generated 2026-11-02).
@misc{flint-doc-algorithms-special-functions-hypergeometric-sums,
author = {{The FLINT team}},
title = {{Sums of hypergeometric series with rational parameters}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/algorithms/special-functions/hypergeometric-sums.html},
note = {Generated 2026-11-02}
}