The bisection method, suitable for implementation on a computer (cf. the Pseudo-code) allows to find the roots of the equation f (x) = 0, based on the following theorem:
Theorem: If f is continuous for x between a and b and if f (a) and f(b) have opposite signs, then there exists at least one real root of f (x) = 0 between a and b.
Presuming there is just one root, in Case 1 the process is terminated. In either Case 2 or Case 3, the process of bisection of the interval containing the root can be repeated until the root is obtained to the desired accuracy. In Figure 5, the successive points of bisection are denoted by x1 , x2, and x3.

One drawback of the bisection method is that it applies only to roots of f about which f (x) changes sign. In particular, double roots can be overlooked; one should be careful to examine f(x) in any range where it is small, so that repeated roots about which f (x) does not change sign are otherwise evaluated (for example, see Steps 9 and 10). Of course, such a close examination also avoids another nearby root being overlooked.
Finally, note that bisection is rather slow; after n iterations the interval containing the root is of length (b - a)/2n. However, provided values of f can be generated readily, as when a computer is used, the rather large number of iterations which can be involved in the application of bisection, is of relatively little consequence.
Solve 3xex = 1 to three decimal places by the bisection method. Cconsider f(x) = 3x - ex, which changes sign in the interval 0.25 < x < 0.27: one tabulates (working to 4D ) as follows:

(Ascertain graphically that there is just one root!)
Denote the lower and upper endpoints of the interval bracketing the root at the n-th iteration by an and bn, respectively (with a1 = 0.25 and b1 = 0.27). Then the approximation to the root at the n-th iteration is given by xn = an + bn)/2. Since the root is either in [an, bn] or [xn, bn] and both intervals are of length bn - an)/2, we see that xn will be accurate to three decimal places when (bn - an)/2 < 5´ 10-4. Proceeding to bisection:

(Note that the values in the table are displayed to only 4D.) Hence the root accurate to three decimal places is 0.258.
x+cosx = 0.
correct to two decimal places (2D ).
x - 0.2sinx - 0.5=0.