I am using the Bisection Method to find a root for:
$$\frac{1.52}{(1+x)^2}-0.5\tan^{-1}\left(\frac{1}{x}+\frac{0.65x}{1+x^2}\right)$$
At $[0.1,2]$ and for $\varepsilon=0.01$
Using $\log_2(\frac{b-a}{\varepsilon})\leq n$ I get that $7.56\leq n$
But applying the method I get $|f(1.7625)|\leq 0.01$ after just $3$ iterations
Is it due to a numerical issue with $\log_2(\frac{b-a}{\varepsilon})$ as it is a division by a small number?
Best Answer
You are looking at the wrong error. In the wikipedia section that you linked, the error concerns the $x$-values $$ |x - x_n| $$ where $x$ is a solution with $f(x)=0$ and $x_n$ is the midpoint in the $n$th iteration. This is very different from the error of the function values $$ |f(x_n)|. $$
A second point that should be mentioned that such a formula usually refers to the maximum number of iterations needed, not the minimum number of iterations: If you are lucky, your algorithm can come close to the solution in earlier iterations.