Mathcad ignore evaluation in false if statements
I am trying to define a piecewise function in Mathcad to move around singularities, but the program breaks down at the singularities even when they are not called.
I created a program that evaluates one function if "w" is greater than or equal to "r", and another function if "w" is less than "r". The second function has a singularity if "w" is equal to "r" but theoretically it shouldn't need to evaluate that function in that case, as "w" isn't less than "r". The program still returns an error in that case though.
Is there a way to set up the program such that MathCad will not try to evaluate the term in the false if statement
Example:
function = if w >= r
pi/2
if w < r
atan(1/(w-r))



