Off[General::spell1];
Clear[Simpson,f0,a,b,n];
Simpson[f0_,a_,b_,n_] :=
Module[{f,k,s,se,so},
  Set@@{f[x_],f0};
  h = N[(b - a)/(2 n),digit];
  x0 = N[a,digit];
  s = 0;
  se = 0;
  For[k=1,k<=n-1,k++,
    Module[{},
      xk = x0 + h 2 k;
      se = N[se + f[xk],digit]; ]];
  so = 0;
  For[k=1,k<=n,k++,
    Module[{}, 
      xk = x0 + h (2k-1);
      so = N[so + f[xk],digit]; ]];
  s = N[h(f[a] + f[b] + 2 se + 4 so)/3,
      digit];
  Srule = s;
  Print[" "];
  Print["n=",n,"    S[n]=",N[Srule,digit]]; ]; 
On[General::spell1];

Clear[digit];
digit = 16;

Clear[f,x];
f[x_] = Exp[-x^2];

For[n = 5, n <= 10, n++, 
Simpson[f[x],0,1, n] ]

norm[f'']=Abs[f''[0]]

Clear[n];
Error[n_] = N[ 1 /(90 n^4),digit]

Error[20]

NIntegrate[f[x],{x,0,1}]