Implement a y-ceiling on a slope function without domains I'm working on a computer software application, dealing with very large quantities of numeric data, and I'd prefer to remove the domain conditions from this graph to help boost performance.
Right now I'm looking at slope functions, with a ceiling set for y.
For example:
y =  x / 4   for x <= 16
y = 16 / 4   for x >  16
I've noticed that there are other relatively simple functions that naturally enforce a ceiling for y, without any domains.
For example:
y = 4 - sqrt( 16 - ( x^2 / 16 ) )
What is going on here that gives y a ceiling?
In general, what are some simple ways to enforce a ceiling, or potentially a floor?
I understand that computing the domain condition might be the best-performing option in many cases, but this can also be dependent on the complexity of the input for x, as well as dependent on the number of domains needed, etc.
Therefore we'd like to keep on hand some simple alternatives to domains, that we can test on a case-by-case basis to see which calculations perform best in different contexts.
 A: In your example $$y=4-\sqrt{16-\frac{x^2}{16}}$$ $y$ has both a ceiling and a floor. The ceiling is $y\le 4$ since it is found by subtracting a nonnegative number from $4$. Remember, the principal square root is never below zero, so subtracting it from something always keeps it the same or reduces it: it never increases. So $y$ is at most $4$.
In your example $y$ also has a floor of $y\ge 0$. This is because the only expression for $x$ is $x^2$ which itself has a natural floor of $0$. Therefore $\frac{x^2}{16}$ has the floor $0$ and $-\frac{x^2}{16}$ has the ceiling $0$ due to the minus sign. Then $16-\frac{x^2}{16}$ has the ceiling $16$, $\sqrt{16-\frac{x^2}{16}}$ has the ceiling $4$, $-\sqrt{16-\frac{x^2}{16}}$ has the floor $-4$ (notice another minus sign), and $4-\sqrt{16-\frac{x^2}{16}}$ has the floor $0$.
In summary, $y$ is limited to $0\le y\le 4$.

The floor and ceiling were set by calculating a square and a square root. Notice that the ceiling was set by taking a square root. If $x$ is greater than $16$ or less than $-16$ then the computer tries to take the square root of a negative number, notices an error, then simply does not plot any point for that value of $x$. That is why your graph has a ceiling and floor for $x$.
Note that for $x$ outside its range, the computer still tries to calculate a value of $y$. That wastes time and slows the graph down. Therefore, if your concern is performance, this is a lousy way to set bounds on $x$. You are much better off telling the computer to only do the calculations for $x$ in its range.
Finally, there are other ways to limit the graph other than to say "for $x\le 16$" but those ways will almost certainly be slower. Here is one way to get your graph that works but will be slow:
$$y=\frac x4+0\cdot\sqrt{16-x}$$
That will guarantee $x\le 16$ but is a lousy way to do so. 
