if is in domain,
The first inequality can be expressed as,
If you chose,
Would make the inequality work can gaurentte the function is defined.
Now you do the second half if, .
There got to be a more simple way to do it. But that is the only one that I came up with.