Skip to main content

Module quadrature

Module quadrature 

Source
Expand description

Adaptive numerical integration on bounded intervals, for @integrate (docs/semantics.md, section 13): the 21-point Gauss–Kronrod rule of QUADPACK, bisecting the part with the largest error estimate until the estimate is within the tolerance. An estimate isn’t a bound: a feature narrower than the rule’s nodes can go unseen, which is why callers give the places where the integrand has features as breakpoints.

Structs§

Estimate
An integral’s value and its error estimate.
Part
One part of an integral: its interval and its estimate.
Table
An integral over [0, 1], by parts with their running totals, to answer for any interval and to invert.

Constants§

MAX_PARTS
The most parts one integral is bisected into.

Functions§

adaptive
f integrated over the intervals between consecutive breaks, by parts bisected where the error is largest until the total error is at most tolerance times the total, and absolute (the scale below which an error doesn’t matter). The parts, in order, or an error if the tolerance can’t be met, or a value isn’t finite.
integral
f over [a, b], to tolerance.
moment
f over [a, b], to tolerance relative to the integral of |f|, so that an integral near zero, like a centred moment’s, converges: None if it doesn’t.
not_converged
rule
The rule on [a, b]: the Kronrod estimate, and its difference from the Gauss one as the error. Each evaluation costs a unit of work.