Theory of Bisection Method for Roots of f(x) = 0

The bisection method is a method for finding roots of an equation f(x) = 0 given that a root occurs in the interval [a,b]. The method is slow but sure given that such an interval can be found and that f(x) is continuous on this interval. First the midpoint c = a + (b-a)/2 of the interval is calculated. Then the function is evaluated at this midpoint. There are three cases:
  1. f(c) is zero. Here c is the root
  2. f(b) and f(c) have opposite signs. In this case the root lies in the interval [b,c].
  3. f(b) and f(c) have the same signs. In this case the root lies in the interval [a,c].
This bisection procedure is repeated until the interval containing the root becomes small enough. As a rule of thumb for base 10 arithmetic you need 3.3 bisections for each decimal digit of accuracy.

Back to bisection method program