Bisection Method
Description
The bisection method is a root-finding method for numerically solving the equation for the real variable where the function is defined on an interval and where and have opposite signs. According to the intermediate value theorem, must have at least one root in the interval .
Each step, the interval is divided in two halves by computing the midpoint of the interval and the value of the function at that point, if it’s a root, the process stops there, otherwise the midpoint now becomes one of the ends of the range. The method continues until the root is found or the error is sufficiently small.
Algorithm
Select the initial values of and , evaluate and , select a tolerance of error .
Calculate the midpoint of the interval:
Determine if the root has been found or where does the root is:
- If , the root is , the iteration stops
- If , the root is the interval
- If , the root is the interval
Recalculate the midpoint
Calculate the relative error, if it’s sufficiently small, the calculation stops, otherwise, continue: