clear all;close all;
f = @(x) sin(x);
x=1.3;
h=0.1;
fprintf('%20s %20s %20s \n','h','der','error');
while h>10^-10
    d = imag(f(x+i*h))/h;
    fprintf('%20.10g %20.10g %20.10g \n',h,d,d-cos(x));
    h = h/10;
end
