Coded Levenberg-Marquardt solver for damped least-squares.