
s=0:0.1:16;
x=pi;

correct_value=1;

for index=1:length(s)
    h_exp=s(index);
    h=10^(-h_exp);
    fxplus=f(x+h); 
    fx=f(x);
    fxminus=f(x-h);
    f2approx=(fxplus-2*fx+fxminus)/(h^2);
    abserr(index)=abs(f2approx-correct_value);
    fprintf('\n \t [h]: %2.2e [ABS.ERR.]: %2.2e',h,abserr(index))
end

semilogy(s,abserr);