26 #ifndef O2SCL_CERN_CAUCHY_H 27 #define O2SCL_CERN_CAUCHY_H 29 #include <o2scl/inte.h> 30 #include <o2scl/inte_gauss_cern.h> 32 #ifndef DOXYGEN_NO_O2NS 72 x[0]=0.96028985649753623;
73 x[1]=0.79666647741362674;
74 x[2]=0.52553240991632899;
75 x[3]=0.18343464249564980;
76 x[4]=0.98940093499164993;
77 x[5]=0.94457502307323258;
78 x[6]=0.86563120238783175;
79 x[7]=0.75540440835500303;
80 x[8]=0.61787624440264375;
81 x[9]=0.45801677765722739;
82 x[10]=0.28160355077925891;
83 x[11]=0.95012509837637440e-1;
85 w[0]=0.10122853629037626;
86 w[1]=0.22238103445337447;
87 w[2]=0.31370664587788729;
88 w[3]=0.36268378337836198;
89 w[4]=0.27152459411754095e-1;
90 w[5]=0.62253523938647893e-1;
91 w[6]=0.95158511682492785e-1;
92 w[7]=0.12462897125553387;
93 w[8]=0.14959598881657673;
94 w[9]=0.16915651939500254;
95 w[10]=0.18260341504492359;
96 w[11]=0.18945061045506850;
115 double &res,
double &err) {
116 double y1, y2, y3, y4;
123 "inte_cauchy_cern::integ_err().",
125 }
else if ((s<a && s<b) || (s>a && s>b)) {
126 return it->integ_err(func,a,b,res,err);
130 h=
it->integ(func,2.0*s-a,b);
133 h=
it->integ(func,a,2.0*s-b);
146 double c1=(bb+aa)/2.0;
147 double c2=(bb-aa)/2.0;
152 for(
int i=0;i<4;i++) {
158 s8+=w[i]*((y1+y2)+(y3+y4));
161 for(
int i=4;i<12;i++) {
167 s16+=w[i]*((y1+y2)+(y3+y4));
171 if (fabs(s16-s8)<=this->
tol_rel*(1.0+fabs(s16))) {
175 if ((1.0+fabs(c*c2))==1.0) {
185 if (bb==b0) loop1=
false;
197 #ifndef DOXYGEN_INTERNAL 212 #ifndef DOXYGEN_NO_O2NS int set_inte(inte< func_t > &i)
Set the base integration object to use (default is inte_cauchy_cern::def_inte of type inte_gauss_cern...
The main O<span style='position: relative; top: 0.3em; font-size: 0.8em'>2</span>scl O$_2$scl names...
virtual int integ_err(func_t &func, double a, double b, double &res, double &err)
Integrate function func from a to b.
invalid argument supplied by user
inte< func_t > * it
The base integration object.
#define O2SCL_CONV2_RET(d, d2, n, b)
Set an error and return the error value, two-string version.
size_t last_iter
The most recent number of iterations taken.
bool err_nonconv
If true, call the error handler if the routine does not converge or reach the desired tolerance (defa...
double s
The singularity (must be set before calling integ() or integ_err())
Base integration class [abstract base].
inte_gauss_cern< func_t > def_inte
Default integration object.
double tol_rel
The maximum relative uncertainty in the value of the integral (default )
Cauchy principal value integration (CERNLIB)
Gaussian quadrature (CERNLIB)