More robust way to compute rt_g.
More robust way to compute rt_g.

Theoretically `r.T g == ||g||^2`. Nevertheless, the second form is beter
because it does not allow negative values to appear during
calculation due to roundoff errors.

antonior92/ip-nonlinear-solver