25#ifndef quantlib_simpson_integral_hpp
26#define quantlib_simpson_integral_hpp
28#include <ql/math/integrals/trapezoidintegral.hpp>
46 Real I = (f(a)+f(b))*(b-a)/2.0, newI;
47 Real adjI = I, newAdjI;
53 newAdjI = (4.0*newI-I)/3.0;
63 QL_FAIL(
"max number of iterations reached");
Real absoluteAccuracy() const
Size maxEvaluations() const
Integral of a one-dimensional function.
SimpsonIntegral(Real accuracy, Size maxIterations)
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Integral of a one-dimensional function.
std::size_t Size
size of a container
static Real integrate(const ext::function< Real(Real)> &f, Real a, Real b, Real I, Size N)