[Math] How to find the root of a polynomial function closest to the initial guess

newton raphsonnonlinear optimizationnumerical methods

I need some easy to implement and fast numerical method that finds the root of a nonlinear function (a polynomial in my case) closest to my initial guess. If I know that there is one root $x^\star_k\in I$ and I start in the middle of $I$, is there a numerical method that guarantees convergence to exactly this root?

Newton's method does not seem to assure that I stay within the interval since it may converge to a zero further away outside the interval, right? Can I modify Newton's Method $x_{n+1}=x_n – \frac{f(x_n)}{f'(x_n)}$ somehow to assure I stay within the interval?

Or, maybe it is not possible at all with Newton's Method but with the Bisection method instead, although at slower pace?

More precisely, I have a 5 to 10th degree polynomial and want to find all roots but know approximately where the roots are, that is, I divided the x-range into intervals $I_k\subseteq X$ that contain only one root $x^\star_k\in I_k$.
I further have some regularity assumption on my function (no infinite derivatives etc).

Thanks in advance for our help.

Best Answer

You can combine bisection and Newton method very efficiently. If you go to this place, on page 359, you will find subroutine RTSAFE (here and here) which does exactly what you want. It is very robust.

I apologize for giving you a reference to Fortran coding. If you can access the books of Numerical Recipes, you will find the equivalent in C and C++.