h = logspace(-16, -1, 50);
x = pi/3;
fp = (sin(x+h)-sin(x))./h;
err = abs(fp - cos(x));
loglog(h,err);