#include <cern_gauss.h>
For any interval , we define
and
to be the 8- and 16-point Gaussian quadrature approximations to
and define
The function integ() returns given by
where and
and the subdivision points
are given by
where is the first number in the sequence
for which
If, at any stage, the ratio
is so small so that is indistinguishable from unity, then the accuracy is required is not reachable and the error handler is called.
Unless there is severe cancellation, inte::tolf may be considered as specifying a bound on the relative error of the integral in the case that and an absolute error if
. More precisely, if
is the number of subintervals from above, and if
then
will nearly always be true when no error is returned. For functions with no singualarities in the interval, the accuracy will usually be higher than this.
This function is based on the CERNLIB routines GAUSS and DGAUSS which are documented at http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/d103/top.html
cst
? Definition at line 89 of file cern_gauss.h.
Public Member Functions | |
virtual int | integ_err (func_t &func, double a, double b, param_t &pa, double &res, double &err) |
Integrate function func from a to b giving result res and error err . | |
virtual double | integ (func_t &func, double a, double b, param_t &pa) |
Integrate function func from a to b . | |
Protected Attributes | |
Integration constants | |
double | x [12] |
double | w [12] |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page