integrateQNG

Calculate the integral of f(x) over the finite interval (a,b) using a simple non-adaptive automatic integrator, based on a sequence of rules with increasing degree of algebraic precision.

This method should only be used for well-behaved integrands, or when speed is a lot more important than accuracy.

Result!Real
integrateQNG
(
Func
Real
)
(
scope Func f
,
Real a
,
Real b
,
Real epsRel = cast(Real)1e-6
,
Real epsAbs = cast(Real)0
)

Examples

// Despite the statement above, integrateQNG() can handle some
// difficulties, such as the endpoint singularity in the following
// example:
double f(double x) { return x^^2 * log(1/x); }
auto i = integrateQNG(&f, 0.0, 1.0);

Meta