Half Interval Search

This program finds roots of a polynomial by searching an interval, that you provide, for a sign change. Once a sign change is detected, the interval is successively halved until a zero is located.

Downloads:

Basic program - halfint.bas

Test case using f=4*x^4-2.5*x^2-x+.5

roots of polynomials - half interval search
please enter the equation in 'function f(x)'
to end search enter 'q' for either interval

enter lower interval (q to quit): -1
enter upper interval (q to quit): 0

no roots found in interval...

enter lower interval (q to quit): 0
enter upper interval (q to quit): 1


root= 0.30357717


enter lower interval (q to quit): q