The following page illustrates graphically the bisection method. As this example shows, a bounding point may lie closer to the root than the midpoint during any particular iteration. However, the bisection method is guaranteed to converge to the proper solution, provided that the initial interval contains a root and provided that we are dealing with a function that crosses the x-axis at the root (compare the following example versus this other one).

An algorithm for the bisection method is given below.

  1. Use incremental search to determine an initial set of bounds, [XSTART, STOP], for the root.
  2. Calculate XMID=(XSTART+XSTOP)/2.

  3. Calculate Y(XMID)*Y(XSTART). If this quantity is less than 0, set XSTOP equal to XMID and repeat from step 2. Otherwise, set XSTART equal to XMID and repeat the process from step 2.
  4. Continue halving the interval until |XSTOP-XSTART| is less than some prescribed tolerance.