Allowed to pass precision to checkGradients

I allowed to pass precision to checkGradients,
and I used %g to format the numbers.

Previous format:

    output violation at precision 0.000000 (max diff=0.000000)
   
New format:

    output violation at precision 1e-14 (max diff=1.42109e-14)