  function error = errNCOpen(a,b,m,DerBound)
%
% Pre:
%       a,b   real scalars that satsify a<=b
%         m   integer that satisfies 2<=m<=7 and 
%  DerBound   an upper bound for the d-th derivative of a 
%             function f(x) defined on [a,b]. Here,
%             d = m if m is odd, and m-1 if m is even. 
% 
% Post:
%     error   an upper bound for the absolute error of the 
%             m-point open Newton-Cotes rule when it is
%             applied to the integral of f(x) from a to b.
%  
   if m==1
     d=1; c= 1/24; 
   elseif m==2
     d=1;  c= 1/4; 
   elseif m==3
     d=3;  c= 28/90; 
   elseif m==4
     d=3;  c= 95/144; 
   elseif m==5
     d=5;  c= 41/140;
   elseif m==6
    d=5;  c= 5257/8640
   else
    d=7;  c= 3956/14175; 
   end;
   error = c*DerBound*((b-a)/(m-1))^(d+2);

