I am writing a function that can be split into cases
(1)$f(x) \leq f(y)$ and $f(x) \geq f(y)$
or into cases
(2)$f(x) < f(y), f(x) = f(y), f(x) > f(y)$
If I have f(x) = f(y), it is theoretically more efficient to use the cases outlined in (2), but is it actually more efficient in practice?
My concerns are that if $f(x) = f(y)$ theoretically, how often will they also be equal computationally? and if it happens that $f(x) \neq f(y)$ theoretically, how often will they be equal computationally? (As this would cause the algoritm to produce a wrong answer).
Note that if $f(x) = f(y)$ theoretically, but computationally are not equal, the algorithm will still produce a correct final answer - just will reach it slightly slower.