I have the function $f(x) = \begin{cases}0 \:\: (x < a) \\ 1/2 \:\: (x = a)\\ 1 \:\: (x > a)\end{cases}$, where $a$ is unknown. I can compute the function for any value of $x$, and seek to determine $a$ (to some degree of accuracy).Given an initial bracket $x_{0} < a < x_{1}$, I subdivide the bracket by defining $x_{2} := \frac{x_{0}+x_{1}}{2}$and computing $f(x_{2})$. Then I have either $x_{0} < a < x_{2}$ or $x_{2} < a < x_{1}$. I could proceed with this approach until the bracketing values agree to some accuracy, and thus solve for $a$.Is there a more efficient algorithm?
Bracketing a discontinuity in a step function
roots