26 #ifndef O2SCL_CERN_GAUSS56_H 27 #define O2SCL_CERN_GAUSS56_H 29 #include <o2scl/inte.h> 30 #include <o2scl/funct.h> 32 #ifndef DOXYGEN_NO_O2NS 53 x5[0]=4.6910077030668004e-02;
54 w5[0]=1.1846344252809454e-01;
55 x5[1]=2.3076534494715846e-01;
56 w5[1]=2.3931433524968324e-01;
57 x5[2]=5.0000000000000000e-01;
58 w5[2]=2.8444444444444444e-01;
59 x5[3]=7.6923465505284154e-01;
60 w5[3]=2.3931433524968324e-01;
61 x5[4]=9.5308992296933200e-01;
62 w5[4]=1.1846344252809454e-01;
64 x6[0]=3.3765242898423989e-02;
65 w6[0]=8.5662246189585178e-02;
66 x6[1]=1.6939530676686775e-01;
67 w6[1]=1.8038078652406930e-01;
68 x6[2]=3.8069040695840155e-01;
69 w6[2]=2.3395696728634552e-01;
70 x6[3]=6.1930959304159845e-01;
71 w6[3]=2.3395696728634552e-01;
72 x6[4]=8.3060469323313225e-01;
73 w6[4]=1.8038078652406930e-01;
74 x6[5]=9.6623475710157601e-01;
75 w6[5]=8.5662246189585178e-02;
83 virtual int integ_err(func_t &func,
double a,
double b,
84 double &res,
double &err) {
86 double rang=b-a, e5=0.0, e6=0.0, ytmp;
88 for(
int i=0;i<5;i++) {
89 ytmp=func(a+rang*x5[i]);
91 ytmp=func(a+rang*x6[i]);
94 ytmp=func(a+rang*x6[5]);
97 err=fabs((e6-e5)*rang);
104 #ifndef DOXYGEN_INTERNAL 117 #ifndef DOXYGEN_NO_O2NS virtual int integ_err(func_t &func, double a, double b, double &res, double &err)
Integrate function func from a to b giving result res and error err.
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
Base integration class [abstract base].
5,6-point Gaussian quadrature (CERNLIB)