#define PI 3.14159265359double f(double x){ return sqrt(400*cos(x)*cos(x)+100*sin(x)*sin(x));}double Romberg(double a, double b, double eps){int m,n,i;double y[11],h=b-a,ep,p,s,q;y[0]=0.5*h*(f(a)+f(b));m=n=1;ep=eps+1.0;while(ep>=eps&&m<=10){ p=0.0; for(i=0;i<n;i++)p+=f(a+(i+.5)*h); p=(y[0])*.5+p*h*.5; s...
|