FLINT3.7.0-dev

acb_calc_integrate_gl_auto_deg

Synopsis#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)source

Attempts to compute ∫abf(t) dt\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 ff is written to num_eval. If verbose is nonzero, the chosen degree is printed.

With Δ=(b−a)/2\Delta = (b - a)/2 and m=(a+b)/2m = (a + b)/2, the integral is ∫−11g\int_{-1}^{1} g with g(t)=Δf(Δt+m)g(t) = \Delta f(\Delta t + m). If gg is holomorphic and ∣g∣≤M|g| \le M inside the ellipse with foci ±1\pm 1 and semi-axes XX and Y=X2−1Y = \sqrt{X^2 - 1}, ρ=X+Y\rho = X + Y, the error of the nn-point Gauss–Legendre rule is at most

64M15(ρ−1)ρ2n−1,\frac{64 M}{15 (\rho - 1) \rho^{2n - 1}},

a slightly weakened form of a bound of Trefethen [Tre2008]. MM is obtained by evaluating ff with order 1 on the rectangle [±X]+[±Y]i[\pm X] + [\pm Y] i mapped to the segment. The function tries X=2,4,8,32,512,…X = 2, 4, 8, 32, 512, \ldots (doubling the exponent) as long as MM is finite, and for each XX the smallest degree nn from the sequence 1,2,4,6,8,12,16,22,32,…1, 2, 4, 6, 8, 12, 16, 22, 32, \ldots (steps of about 2\sqrt{2}) that meets the tolerance; the smallest nn 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
Cite this page

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-11-02).