Skip to main content

gauss_kronrod

Function gauss_kronrod 

Source
pub fn gauss_kronrod<F: FnMut(f64) -> f64>(f: F, a: f64, b: f64) -> (f64, f64)
Expand description

Integrate f over [a, b] with the seven-point Gauss and fifteen-point Kronrod pair: the Kronrod value, and the magnitude of its difference from the Gauss value as the estimate of what it still misses.

Fifteen evaluations, shared. The Kronrod rule is exact for polynomials up to degree twenty-two, the Gauss rule up to thirteen; where the two agree the integrand is polynomial enough that both are right, and the gap is a fair measure of the error where they are not. A reversed interval integrates to the negative, as gauss_legendre does.