Example
> restart:f:=x->ln(cos(x));
> df:=D(f):ddf:=D(df):dddf:=D(ddf):ddddf:=D(dddf):dddddf:=D(ddddf);
> plot(dddddf,-1..1);
So that the fifth derivative is bounded by 400.
>
> for i from 1 to 2 do h:=10.^(-i): df1:=1/(12*h)*(f(0.4-2*h)-8*f(0.4-h)+8*f(0.4+h)-f(0.4+2*h)): maxerr:=(h^4)*400./30:acterr:=abs(df1-df(0.4)): print(h,df1,maxerr,acterr); od:
Again, the increased accuracy is evident.