from math import * for p in range(15): h=10.0**(-p) print p, abs((sin(0.5+h)-sin(0.5-h))/(2.0*h)-cos(0.5))