Example revisited
> f:=x->ln(cos(x));
> df:=D(f):ddf:=D(df):dddf:=D(ddf):ddddf:=D(dddf):
> plot(ddddf,-1..1);
The fourth derivative is therefore bounded by 60.
> :for i from 1 to 3 do h:=10.^(-i): ddf1:=(f(0.4-h)-2*f(0.4)+f(0.4+h))/h^2: maxerr:=60.*h^2/12: acterr:=abs(ddf1-ddf(0.4)): print(h,ddf1,maxerr,acterr); od:
It is now clear that round-off error have a significant effect on the third result.