The conjugate-gradient solver is a powerful method of least-square
inversion because of its remarkable algebraic properties. In practice, the
theoretical basis of conjugate gradients can be distorted by
computational errors. In some applications of inversion, we may want
to do that on purpose, by applying inexact adjoints in
preconditioning. In both cases, a safer alternative is the method of
conjugate directions. Jon Claerbout's `cgstep()`

program actually
implements a short-memory version of the conjugate-direction
method. Extending the length of the memory raises the cost of iterations, but can speed up the convergence.

11/12/1997