Check gradient according to max absolute difference