The minimization in the descent algorithm for inner loop iteration n is given by
where αn is the step size and dn are the conjugate direction vectors:
or
The steepest descent occurs when β = 0. This happens either every NiterSD iterations or when dot2 > CGtol * dot1, where
The refined step size is computed in the second inner loop pass, m = 2, as