I need to solve polynomial equation and I know an interval with a root. I try to use Newton method, but sometimes it fails due to overshooting. So instead I try to adopt an interval method, to keep myself in interval - it works, but not always. Let's see a simple example function: y=x2+2x-30 and interval [a,b] Derivative: y'=2x+2 What I do:
- x0 = a0 + (b0-a0)/2 //midpoint
- a_interim = x0 - f(x0)/f'(a0); b_interim = x0 - f(x0)/f'(b0)
- find intersection of intervals [a0,b0] and [a_interim,b_interim] - call it [a1,b1]
- iterate to x1,x2 ... xn Eventually xn converges to a root. The problem occurs if my interval includes a minima point, at x=-1, algorithm converges to a weird number, not a root. How to overcome this? In my problem I can ensure a single root within interval, but not the absence of a minima point.
Thanks.