Solution (source code)

= Solution
{c}

If the starting length is $L=b-a$, then after $k$ interval halvings the current midpoint is at most $L/2^{k+1}$ from some root remaining in the bracket. Thus, with the midpoint returned after those halvings, it suffices to take
$$
\boxed{k\geq\max\left(0,\left\lceil\log_2\frac{L}{2\epsilon}\right\rceil\right).}
$$
If iterations instead count midpoint evaluations starting with the initial midpoint as evaluation one, the usual bound is $n\geq\lceil\log_2(L/\epsilon)\rceil$, with at least one evaluation unless an endpoint root has already been found. Stating the counting convention avoids an apparent one-step discrepancy.