newton function

Newton-Raphson method for numerical optimization