Power series in ball arithmetic
- Cost
- operations for inversion, division, square roots, exponentials, logarithms and trigonometric functions of a series of length by Newton iteration; for the recurrences, where is the length of the input; composition to .
A power series truncated to length is stored as the polynomial , and an operation on series computes the first coefficients of its result. Since the first coefficients of , , , , for an analytic function , ... depend only on the first coefficients of the inputs, truncated series arithmetic is exact arithmetic in the ring . With ball coefficients, every algorithm that is correct in exact arithmetic therefore becomes an algorithm that returns enclosures, simply by performing each ring operation in ball arithmetic. Rigor is automatic; what the choice of algorithm decides is the speed and the width of the enclosures. The generic algorithms (Newton iteration, middle products, the formulas for the elementary functions) are described in Newton iteration for power series and division; the focus here is on what changes with balls.
Rigorous Taylor expansions#
If is the series , then is the Taylor polynomial , and composing series operations yields the Taylor polynomial of a composite function (the chain rule is built into series composition). In ball arithmetic may be a ball, and then each computed coefficient contains for every . This is forward-mode automatic differentiation of arbitrary order with rigorous error bounds, and it is how FLINT computes derivatives of special functions, Taylor models for integration and root finding (Isolating and refining real roots), and the Taylor coefficients used by arb_calc_func_t and acb_calc_func_t evaluators.
For a transcendental function , the functions in arb_poly.h and acb_poly.h usually compute the series of at the constant term of the argument, , by a method specific to , and then compose it with the nonconstant part of :
using _arb_poly_compose_series (or simpler formulas when is a monomial). The gamma function (Stirling's series at a shifted argument, or zeta values at integers), the zeta function (Euler–Maclaurin summation), the arithmetic-geometric mean and the sinc function at a ball containing 0 are computed this way. The Lambert W function, the elementary functions and the inverse functions use Newton iteration or differential equations directly on the series.
Recurrences and Newton iteration#
Many series operations can be computed either by a recurrence for the coefficients or by Newton iteration. For the inverse , the recurrence is
and Newton iteration doubles the number of correct coefficients with
using that the first coefficients of vanish when is correct to terms, so that only a middle product of length is needed (Middle products and the transposition principle). For the exponential , the recurrence follows from the differential equation :
and Newton iteration solves , updating and together as in [HZ2004]. The recurrences cost operations for an input of length ; Newton iteration costs .
In exact arithmetic, the choice is purely a matter of speed. In ball arithmetic, the two methods also produce enclosures of different width. The recurrence for uses all previous , and each already carries a radius that includes the rounding errors and the propagated errors of all earlier coefficients. Ball arithmetic cannot exploit the cancellation between these correlated errors: a rounding error in is propagated to with the weight of the coefficient of in the majorant series , whose coefficients can grow exponentially faster than those of (for example, when the alternate in sign). Newton iteration computes the second half of the coefficients from a product involving only the first half, through a much shorter chain of dependencies, and the radius growth is correspondingly smaller. FLINT therefore uses the recurrences only for very short series or special shapes:
_arb_poly_inv_seriesuses the recurrence for all coefficients only if or the input has length 2, and otherwise only for the first 4 coefficients, followed by Newton iteration, although the recurrence would be faster up to much larger lengths;_arb_poly_div_seriesuses the recurrence for (or a divisor of length 2) and the product otherwise;_arb_poly_exp_seriesuses the recurrence up to an input length of 750 at bits (or ), and Newton iteration beyond.
The same reasoning applies to the square root (Newton iteration for without divisions, , followed by one Karp–Markstein step [KM1997] that gives from at half the length), and to the trigonometric functions: for long series, _gr_poly_sin_cos_series uses a simultaneous Newton iteration for and derived from that for , and _gr_poly_tan_series Newton iteration for the inverse of ; the inverse functions are integrals of algebraic expressions in and , such as , and the logarithm is .
Scaling#
The coefficients of the series that arise in practice often decrease like , where is the radius of convergence. Ball arithmetic measures errors relative to the size of each coefficient, so the relative accuracy of the coefficients of a product is governed by the largest terms in each convolution sum: if the coefficients of both factors decay at the same rate, all products have the same order of magnitude, and every coefficient of the result is obtained to nearly full relative precision. The block multiplication algorithm (Multiplying polynomials with ball coefficients) preserves this property by rescaling . If the series decay at different rates, the radii of the small coefficients are dominated by errors of larger terms, and it can help to rescale the variable explicitly, computing for a suitable and undoing the scaling at the end.
Composition and reversion#
Composition with and reversion (the series of the compositional inverse) are computed by the generic functions _gr_poly_compose_series and _gr_poly_revert_series (Composition and modular composition). Over the ball contexts they choose Horner's scheme for short input, divide and conquer when the composition is only slightly longer than , the baby-step giant-step algorithm of Brent and Kung [BrentKung1978] with operations below a precision-dependent cutoff , and the algorithm of Kinoshita and Li [KL2024] above it. Reversion uses the fast Lagrange inversion of [Joh2015b] below five times that cutoff and Newton iteration on the composition above.
Use in FLINT#
- Power series functions of arb_poly.h and acb_poly.h implemented in the modules themselves:
_arb_poly_inv_series,_arb_poly_div_series,_arb_poly_exp_series(with_arb_poly_exp_series_basecase),_arb_poly_sqrt_series,_arb_poly_pow_arb_series,_arb_poly_sinh_cosh_series,_arb_poly_sinc_series,_arb_poly_lambertw_series,_arb_poly_gamma_seriesand its relatives,_arb_poly_zeta_series, and the complex versions. - Wrappers of gr_poly.h over the ball contexts: the logarithm, the inverse trigonometric and hyperbolic functions, sine and cosine (for length at least 3), tangent and cotangent, the reciprocal square root (
_gr_poly_rsqrt_series_newton), binary powering, composition, reversion, Taylor shifts, derivatives and integrals. - Middle products for Newton iteration:
_arb_poly_mulmid,_acb_poly_mulmid. - Users of the Taylor expansion idiom: arb_calc.h, acb_calc.h, the hypergeometric functions of arb_hypgeom.h and acb_hypgeom.h with series arguments, and
acb_dirichlet_zeta_jet.
Referenced from#
References#
- [HZ2004] G. Hanrot and P. Zimmermann, "Newton Iteration Revisited" (2004), http://www.loria.fr/~zimmerma/papers/fastnewton.ps.gz
- [KM1997] A. H. Karp and P. Markstein, "High-precision division and square root", ACM Transactions on Mathematical Software 23:4 (1997), 561–589
- [BrentKung1978] Brent, R. P. and Kung, H. T. : Fast Algorithms for Manipulating Formal Power Series, J. ACM 25:4 (1978) 581–595
- [KL2024] Y. Kinoshita and B. Li, "Power series composition in near-linear time", 2024, https://arxiv.org/abs/2404.05177
- [Joh2015b] F. Johansson, "A fast algorithm for reversion of power series", Math. Comp. 84 (2015), 475-484, http://doi.org/10.1090/S0025-5718-2014-02857-3
The FLINT team, “Power series in ball arithmetic,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/algorithms/ball-arithmetic/power-series.html (generated 2026-11-02).
@misc{flint-doc-algorithms-ball-arithmetic-power-series,
author = {{The FLINT team}},
title = {{Power series in ball arithmetic}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/algorithms/ball-arithmetic/power-series.html},
note = {Generated 2026-11-02}
}