# Which numerical polynomial solvers succeed where Newton-Raphson fails?

I have fitted several polynomial surrogate model $y = f(x)$ to differnt sets of data and need to find the inverse of the surrogate models, i.e. $x = f^{-1}(y)$. The data is very well fit by polynomials - errors <1E-15. And all data is in the range [0,2]. However some of the polynomial surrogate models are quite flat, i.e. $y\sim$constant and the Newton-Raphson fails. How to proceed? Other than Brute force, how can I solve these polynomials?

In addition I have tried to use the polynomial regression to model the data $x = f(y)$, however due to the flat $y$ data the polynomial regression models do not appear to fit very well.

• When NR fails and your solution is bound go to Bisection. – John Alexiou Dec 14 '15 at 20:12
• Thanks ja72, I have resorted to the Bisection. However I was hoping a more elegant method would present itself. – user2350366 Dec 15 '15 at 17:25
• Why do you think bisection is not elegant. If anything NR tries to be too smart and fails most of the time (causing large jumps). If you want you can start with bisection and when the problem is linear enough switch to NR but don't update the slope as aggressively. – John Alexiou Dec 15 '15 at 19:12

## 1 Answer

Since your solution is bound and non linear the obvious choice for me is bisection.

Once you have a working solution you might to try to optimize it a bit by switching to NR when the interval is small enough for the problem to be almost linear.