acb_calc_integrate_gl_auto_deg
#include <flint/acb_calc.h>int acb_calc_integrate_gl_auto_deg(acb_t res, slong * num_eval, acb_calc_func_t func, void * param, const acb_t a, const acb_t b, const mag_t tol, slong deg_limit, int verbose, slong prec)sourceAttempts to compute \int_a^b f(t)\, dt with one Gauss–Legendre rule of degree at most deg_limit, chosen automatically so that the error bound is below tol. Returns ARB_CALC_SUCCESS and the enclosure in res if this is possible, and ARB_CALC_NO_CONVERGENCE with res indeterminate otherwise. The number of evaluations of f is written to num_eval. If verbose is nonzero, the chosen degree is printed.
With \Delta = (b - a)/2 and m = (a + b)/2, the integral is \int_{-1}^{1} g with g(t) = \Delta f(\Delta t + m). If g is holomorphic and |g| \le M inside the ellipse with foci \pm 1 and semi-axes X and Y = \sqrt{X^2 - 1}, \rho = X + Y, the error of the n-point Gauss–Legendre rule is at most
a slightly weakened form of a bound of Trefethen [Tre2008]. M is obtained by evaluating f with order 1 on the rectangle [\pm X] + [\pm Y] i mapped to the segment. The function tries X = 2, 4, 8, 32, 512, \ldots (doubling the exponent) as long as M is finite, and for each X the smallest degree n from the sequence 1, 2, 4, 6, 8, 12, 16, 22, 32, \ldots (steps of about \sqrt{2}) that meets the tolerance; the smallest n found is used. The nodes and weights are computed by arb_hypgeom_legendre_p_ui_root [JM2018] (Roots of Legendre polynomials and Gauss–Legendre nodes) and cached (per thread), and the evaluations are distributed over threads when flint_get_num_threads() is greater than one.
References#
- [Tre2008] L. N. Trefethen, "Is Gauss Quadrature Better than Clenshaw-Curtis?", SIAM Review, 50:1 (2008), 67-87, https://doi.org/10.1137/060659831
- [JM2018] F. Johansson and M. Mezzarobba, "Fast and rigorous arbitrary-precision computation of Gauss-Legendre quadrature nodes and weights", preprint (2018), https://arxiv.org/abs/1802.03948
The FLINT team, “acb_calc_integrate_gl_auto_deg (acb_calc.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb_calc/acb_calc_integrate_gl_auto_deg.html (generated 2026-10-20).
@misc{flint-doc-acb-calc-acb-calc-integrate-gl-auto-deg,
author = {{The FLINT team}},
title = {{acb\_calc\_integrate\_gl\_auto\_deg (acb\_calc.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/acb_calc/acb_calc_integrate_gl_auto_deg.html},
note = {Generated 2026-10-20}
}