[ Edit: I'm all wrong. See lastchance's explanation below. ]
By the way, the algorithm isn't very good. It could skip over the solution to an area where f(x) is positive (or negative) for all values between Xlower and Xupper. Once that happens, it will never find the solution.
The bisection algorithm, if implemented correctly, always maintains Xlower and Xupper such that f(Xlower) and f(Xupper) have opposite signs (i.e. their product is less than 0).
So, as long as f() is continuous (and a polynomial is) and you start with initial points with f(x) of opposite signs then it will always find a solution.
Whether min01's code is going to do that is another matter entirely.