Add newton-raphson algorithm