fix newton raphson