Actually both potential roots lie in the interval [0, 1], so the function ended up checking both roots all the time. The new implementation explains why only one of the roots is valid; it saves two square roots and a bunch of other computations.
Actually both potential roots lie in the interval [0, 1], so the function ended up checking both roots all the time. The new implementation explains why only one of the roots is valid; it saves two square roots and a bunch of other computations.