improved gradient

define the real natural distance gradient with sqrt(x^2)
robust convergence criterion
dithered with numerical epsilon