FLINT3.7.0-dev
Module · 8 functions

acb_calc.h

#include <flint/acb_calc.h>

This module computes rigorous enclosures of integrals \int_a^b f(t)\, dt of complex functions along the segment from a to b in the complex plane. The function is given by an evaluator that encloses f on a complex ball and reports when f is not holomorphic there. The main function acb_calc_integrate bisects the path adaptively; on each segment it uses either the trivial enclosure (b - a) f([a, b]) or a Gauss–Legendre quadrature rule whose error is bounded through a bound for |f| on an ellipse around the segment. This gives exponential convergence for piecewise holomorphic integrands and correct results for integrands with discontinuities, branch points and singularities near the path [Joh2018a]. The guide Rigorous numerical integration explains how to write integrands and choose the parameters, Rigorous numerical integration gives the algorithm and its error bounds, and the tutorial Rigorous numerical integration computes several integrals in complete programs.

AlgorithmRigorous numerical integrationHow acb_calc_integrate computes enclosures of integrals of analytic functions along line segments in the complex plane, combining direct interval enclosures, Gauss–Legendre quadrature with error bounds from bounds of the integrand on Bernstein ellipses, and adaptive bisection; with the stopping rules and the role of the user's evaluation function.

Integrands#

The type of an integrand, a pointer to a function

int func(acb_ptr out, const acb_t inp, void * param, slong order, slong prec)

which computes f on the complex ball inp at a precision of about prec bits; param passes user data through. The return value is reserved for an error code and should be 0. out and inp are not aliased.

More

Integration#

int acb_calc_integrate(acb_t res, acb_calc_func_t func, void * param, const acb_t a, const acb_t b, slong rel_goal, const mag_t abs_tol, const acb_calc_integrate_opt_t options, slong prec)

Sets res to an enclosure of \int_a^b f(t)\, dt along the straight line from a to b, where f is given by func and param. Returns ARB_CALC_SUCCESS if the integration converged to the requested accuracy on all segments and ARB_CALC_NO_CONVERGENCE otherwise; in both cases res is a valid enclosure, which is finite only if a and b are finite and f is bounded on the path. Improper integrals must be truncated or transformed by the caller.

Full documentation

Options for acb_calc_integrate. acb_calc_integrate_opt_t is an array of one acb_calc_integrate_opt_struct. The fields are:

  • slong deg_limit: the largest Gauss–Legendre degree on a segment; default (if 0 or negative) 0.5 \min(\mathit{prec}, \mathit{rel\_goal}) + 60;
  • slong eval_limit: the approximate maximal number of evaluations of f; default 1000\,\mathit{prec} + \mathit{prec}^2;
  • slong depth_limit: the maximal number of segments waiting to be processed (memory use is proportional to it); default 2\,\mathit{prec};
  • int use_heap: if 1, process the segment with the largest error first (a priority queue) instead of the most recently created one (a stack);
  • int verbose: 1 prints a summary, 2 also information on each segment.
More

Initialises options with all fields 0, which selects the defaults.

Full documentation

Local integration algorithms#

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)

Attempts 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.

More

Older integration functions#

void acb_calc_cauchy_bound(arb_t bound, acb_calc_func_t func, void * param, const acb_t x, const arb_t radius, slong maxdepth, slong prec)

Sets bound to a ball containing

C(x, r) = \frac{1}{2\pi r} \oint_{|z - x| = r} |f(z)|\, |dz| = \int_0^1 |f(x + r e^{2\pi i t})|\, dt,

where r is radius, by a step sum over n = 16, 32, 64, \ldots arcs of the circle (at most maxdepth doublings), stopping when the enclosure excludes zero. The whole circle is subdivided uniformly, without adaptivity.

int acb_calc_integrate_taylor(acb_t res, acb_calc_func_t func, void * param, const acb_t a, const acb_t b, const arf_t inner_radius, const arf_t outer_radius, slong accuracy_goal, slong prec)

Computes \int_a^b f(t)\, dt along the segment from a to b (both finite) by Taylor polynomials of f centred at uniformly spaced points, with truncation errors bounded by the Cauchy integral formula. The singularities of f must lie at distance greater than outer_radius from the path; the steps do not exceed inner_radius, which must be smaller (half of outer_radius gives about one bit per term). The truncation error targets 2^{-\mathit{accuracy\_goal}} in absolute terms; arithmetic is done at prec bits. This function uses derivatives of f (order greater than 1) and is superseded by acb_calc_integrate.

More

References#

Cite this page

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