I need to avoid using an if statement that does a $\geq$ comparison, (I'm writing HLSL code for the xbox).
I need a function such that $f(x, y) = 0$ when $x < y$ and $f(x,y)=1$ when $x \geq y$.
(Shader programmers note, I can't use the step function as it's just as slow in this case).
Sorry if this question has cropped up before, I'm not sure what terms to use (so if someone can point me in the right direction, or improve my question tagging that'd be great).
What about something like $f(x,y) = \dfrac{x-y}{2|x-y|} + \frac{1}{2}$? When $x<y$, we get 0 and when $x>y$, we get 1. However, it depends on how the language interprets $0/0$ for the case when $x=y$. If it was something like java, you could just catch a divide by zero exception and have it return 1. Then this function would great.
Of course, this depends on having a form of the absolute value statement for the language that doesn't use an if statement - but many languages have very witty inbuilt functions for this case. Is this sort of what you were looking for?