A least-squares algorithm for nonlinear regression: error analysis and numerical results