The Bisection Method
Bisection halves a sign-changing interval at every step, giving guaranteed but linear convergence to a root of a continuous function.
Trapping a root by sign change
If a continuous function f is negative at a and positive at b, the intermediate value theorem guarantees a root between them. Bisection evaluates f at the midpoint m = (a+b)/2, then keeps whichever half still shows a sign change. Repeating halves the interval each step, and the midpoint of the final interval approximates the root.
def bisect(f, a, b, tol=1e-10, nmax=200):
fa = f(a)
for _ in range(nmax):
m = 0.5*(a+b)
fm = f(m)
if abs(fm) == 0 or 0.5*(b-a) < tol:
return m
if (fa < 0) != (fm < 0):
b = m
else:
a, fa = m, fm
return 0.5*(a+b)
Convergence rate
The interval width after n steps is (b-a)/2^n, so the error is halved every iteration. This is linear convergence with rate 1/2, gaining about one binary digit (0.3 decimal digits) per step. Reaching double-precision accuracy from a unit interval takes about 52 steps, regardless of the function.
Strengths and limits
Bisection is completely reliable when a valid bracket exists: it cannot diverge and needs only that f be continuous and change sign. Its weaknesses are speed and the requirement of an initial bracket. It cannot find roots where the function touches zero without crossing (even multiplicity), because no sign change occurs there.
Because of its guaranteed convergence, bisection is the safe fallback inside hybrid solvers and a dependable choice for well-behaved one-dimensional problems in engineering models, including parameter searches in the design studies for the breeder Hyperion.