Module quadrature::clenshaw_curtis [] [src]

The clenshaw_curtis module provides a integrate function with the same signature as quadrature::integrate. The implemented variant of clenshaw curtis quadrature is adaptive, however the weights change for each adaptation. This unfortunately means that the sum needs to be recalculated for each layer of adaptation. It also does not allocate on the heap, however it does use a [f64; 129] to store the function values. It has a hard coded maximum of approximately 257 function evaluations. This guarantees that the algorithm will return. The clenshaw curtis algorithm exactly integrates polynomials of order N. This implementation starts with an N of approximately 5 and increases up to an N of approximately 257. In general the error in the algorithm decreases exponentially in the number of function evaluations. In summery clenshaw curtis will in general use more stack space and run slower than the double exponential algorithm, unless clenshaw curtis can get the exact solution.

Functions

integrate

Integrate an analytic function over a finite interval. f is the function to be integrated. a is left limit of integration. b is right limit of integration target_absolute_error is the desired bound on error