# Thread: Bisection

1. ## Bisection

Hello I need help

If the bisection method is applied with starting interval [2^m,2^*m+1)], where m is a positive or negatie integer, how any steps should be taken to compute the root to full machine precision on a 32-bit word length computer?

I shouse use the formula n> (log(b-a)-log(error) ) / log(2)

but i have no idea how to use it

thank you

2. Depends on how numbers are represented

In the formula n > (log(b-a)-log(error)) / log(2), n is the number of iterations, a and b are the ends of the interval that contains the root, error is the desired absolute error (i.e., the maximum difference between the answer and the actual root), and log can be computed to any base. In your case, a = 2^m and b = 2^(m+1) (please re-read your post before submitting to avoid typos).

The issue is what error is. Naively, it may be 2^(-32). The standard floating-point numbers are represented as $s\times 2^{-e}$ where s is the significand (or mantissa) and e is the exponent. In the 32-bit (also called single precision) floating-point numbers, significand takes 24 bits. So, for example, numbers between $2^5$ and $2^6-1$ are represented by 6 bits for the integer part plus 24 - 6 = 18 bits for the fractional part. Thus, the error is $2^{-18}$. Therefore, $(b - a)/\text{error} = 2^5 / 2^{-18} = 2^{23}$. (Note that $\log(b-a) - \log(\text{error}) = \log((b - a)/\text{error})$.) One can check that $(b - a)/\text{error}$ is the same for other intervals: $[2^6, 2^7)$, $[2^{10}, 2^{11})$, etc.

In your course, it must have been explained how to connect the number of bits in the machine word with the machine precision.

3. ok got it
thank you very much!!