#include #include "nr.h" using namespace std; DP NR::qsimp(DP func(const DP), const DP a, const DP b) { const int JMAX=20; const DP EPS=1.0e-10; int j; DP s,st,ost=0.0,os=0.0; for (j=0;j 5) if (fabs(s-os) < EPS*fabs(os) || (s == 0.0 && os == 0.0)) return s; os=s; ost=st; } nrerror("Too many steps in routine qsimp"); return 0.0; }