Expand description
integrate: adaptive Gauss–Kronrod quadrature of a vector-valued
function over an interval, in Scalars.
What it returns is an enclosure in two parts, and the two have different standing:
- The rule’s own value is enclosed. Every node and weight of the
7-point Gauss / 15-point Kronrod pair is taken as the interval between
the two
f64s around its tabulated value, so it contains the exact node and weight, and the integrand is evaluated in interval arithmetic at those intervals. The sum therefore encloses what the exact rule gives for the integrand — rounding, and any width the integrand’s own data carries, included. - The rule’s truncation error is estimated, not proven. It is the
difference between the Kronrod and the Gauss value of each panel: the
standard estimate, which for a smooth integrand vastly overestimates
the Kronrod value’s error (that is what makes it a usable bound in
practice), but which a rigorous enclosure would replace by a bound on a
high derivative of the integrand — something a NURBS integrand over a
trimmed domain does not offer cheaply. The result is widened by it, so
that width states how well the integral is known; it is honest about
being an estimate in
Integral::convergedand in the docs of every caller, rather than claiming to be proven.
Quadrature’s tolerance and panel budget only decide how hard the
search tries: a tighter tolerance gives a narrower result, and a budget
run out gives a wider one, never a different answer.
integrate_polynomial is for an integrand known to be a polynomial
of bounded degree on every panel. There the Gauss–Legendre rule of
enough points is exact, so there is no truncation error to estimate,
no halving, and the enclosure is the rule’s value alone — proven, and
from a fifth of the evaluations a 15-point panel takes.
Structs§
- Integral
- An integral, as
integratefinds it. - Quadrature
- How hard
integratetries: until every component’s estimated error is belowrelative_tolerancetimes the integral of its absolute value, or until it has split the interval intomax_panelspanels.
Constants§
- MAX_
POLYNOMIAL_ DEGREE - The highest degree of a polynomial
integrate_polynomialintegrates.
Functions§
- integrate
- The integral of the
components-valuedffrombreaks[0]to the last ofbreaks, each consecutive pair a panel to start with — where the integrand is not smooth, say, at the knots of a spline. - integrate_
polynomial - The integral of the
components-valuedffrombreaks[0]to the last ofbreaks, wherefis a polynomial of degree at mostdegreebetween every two consecutive breaks — a spline, say, split at its knots.