Gauss-Newton algorithm

Implement the Gauss-Newton algorithm.