Demonstration that making h smaller in differentiation difference formulas may not be a good thing....

round[x_]:=If[x>0,Floor[x+1/2],Ceiling[x-1/2]]
roundTonth[x_,n_]:=Module[
{m=Floor[Log[10,Abs[x]]]},
N[round[x*10^(-m+n-1)]/10^(-m+n-1)]
]
roundTonth[1/100*Pi,4]
roundTonth[1/10*Pi,4]
roundTonth[Pi,4]
roundTonth[10*Pi,4]
roundTonth[100*Pi,4]

ApproxDiff[x_,h_]:=(f[x+h]-f[x])/h
g[x_]:=Sin[x]
f[x_]:=roundTonth[g[x],4]
g[.12]
f[.12]
(* So epsilon is on the order of 5/100000 *)
Clear[h]
Plot[{f[x]-g[x]},{x,0,Pi/2}]
epsilon=N[5/100000]
(* M is a bound on the second derivative, which is Sine *)
M=1
(* this is the upperbound function *)
bound[h_]:=M*h/2+2epsilon/h
Solve[bound'[h]==0,h]

h=.04
Plot[{f[x],ApproxDiff[x,h]},{x,0,Pi/2}]
Plot[{g'[x]-ApproxDiff[x,h]},{x,0,Pi/2}]