#include #include #include "nr.h" using namespace std; // Driver for routine rtsec DP fx(const DP x) { return NR::bessj0(x); } int main(void) { const int N=100,NBMAX=20; const DP X1=1.0,X2=50.0; int i,nb=NBMAX; DP xacc,root; Vec_DP xb1(NBMAX),xb2(NBMAX); NR::zbrak(fx,X1,X2,N,xb1,xb2,nb); cout << endl << "Roots of bessj0:" << endl; cout << setw(20) << "x" << setw(16) << "f(x)" << endl; cout << fixed << setprecision(6); for (i=0;i