Improved performance in newton (finite difference) solver