Conjugate Gradient Search

Initialize

Set , , and

Make the step

Calculate:

and

Find residual

If is small enough then stop.

Find the next direction

Calculate:

and