#include #include using namespace std; #define NUMBER 100 int flag=0; double cf1(double kx){ if(flag==0){ if (kx!=0) return 1/kx; else return 0; } else if(flag==1) { return 4/(1+kx*kx); } } double simpson(double a,double b,int n){ double sum=0,h=(b-a)/n; sum+=cf1(a)+cf1(b); for(int i=0;iE||t[0][ptr-1]-t[0][ptr]>E){ ptr++; double temp1=ptr; double temp2=pow(2,temp1-1); double temp3=0; h[ptr]=h[ptr-1]/2; t[ptr][0]=t[ptr-1][0]/2; for(int i=0;i