#include #include #include #include "nr.h" using namespace std; // Driver for routine gaujac DP func(const DP ak, const DP x) { return 1.0/sqrt(1.0-ak*ak*(1.0+x)/2.0); } int main(void) { const DP PIBY2=1.570796326794896619; int i,n; DP ak,alf=(-0.5),bet=(-0.5),checkw,checkx,xx; for (;;) { cout << "Enter N (or 0 to stop): "; cin >> n; cout << endl; if (n < 1) break; Vec_DP x(n),w(n); NR::gaujac(x,w,alf,bet); cout << " #" << setw(13) << "x(i)" << setw(15) << "w(i)" << endl; cout << fixed << setprecision(6); for (i=0;i