for(x=0;x<1-2*h;x+=2*h){ /*範囲指定*/
sum+=(f(x) + 4*f(x+h) + f(x+2*h)) * h/3; /*シンプソンの公式*/
printf("%f %f\n",sum,x);