Returns Integral of function between a and b.
Based on original CERNLIB routine DGAUSS by Sigfried Kolbig converted to C++ by Rene Brun
This function computes, to an attempted specified accuracy, the value of the integral.
Method: For any interval [a,b] we define g8(a,b) and g16(a,b) to be the 8-point and 16-point Gaussian quadrature approximations to
I = \int^{b}_{a} f(x)dx
and define
r(a,b) = \frac{\left|g_{16}(a,b)-g_{8}(a,b)\right|}{1+\left|g_{16}(a,b)\right|}
Then,
G = \sum_{i=1}^{k}g_{16}(x_{i-1},x_{i})
where, starting with x_{0} = A and finishing with x_{k} = B, the subdivision points x_{i}(i=1,2,...) are given by
x_{i} = x_{i-1} + \lambda(B-x_{i-1})
\lambda is equal to the first member of the sequence 1,1/2,1/4,... for which r(x_{i-1}, x_{i}) < EPS. If, at any stage in the process of subdivision, the ratio
q = \left|\frac{x_{i}-x_{i-1}}{B-A}\right|
is so small that 1+0.005q is indistinguishable from 1 to machine accuracy, an error exit occurs with the function value set equal to zero.
Accuracy: The user provides absolute and relative error bounds (epsrel and epsabs) and the algorithm will stop when the estimated error is less than the epsabs OR is less than |I| * epsrel. Unless there is severe cancellation of positive and negative values of f(x) over the interval [A,B], the relative error may be considered as specifying a bound on the relative error of I in the case |I|>1, and a bound on the absolute error in the case |I|<1. More precisely, if k is the number of sub-intervals contributing to the approximation (see Method), and if
I_{abs} = \int^{B}_{A} \left|f(x)\right|dx
then the relation
\frac{\left|G-I\right|}{I_{abs}+k} < EPS
will nearly always be true, provided the routine terminates without printing an error message. For functions f having no singularities in the closed interval [A,B] the accuracy will usually be much higher than this.
Error handling: The requested accuracy cannot be obtained (see Method). The function value is set equal to zero.
Note 1: Values of the function f(x) at the interval end-points A and B are not required. The subprogram may therefore be used when these values are undefined
Implements ROOT::Math::VirtualIntegratorOneDim.
Definition at line 52 of file GaussIntegrator.cxx.