f=@(x) log(x);

g=@(h) (4*f(1+h)-3*f(1)-f(1-2*h))./(6*h);

H=[0.1,0.01,0.001,1e-4,1e-5];
figure()
loglog(H,abs(g(H)-1))
hold on
loglog(H,H.^2)
xlabel('h')
ylabel('error')
legend('error','second order in h')
