Can this clamp function (designed for calculators without ABS) be optimized? I realized one day that I could evaluate whether a value is negative or not with one simple function:
$$\frac{x}{\sqrt{x^2}}$$
This would return $-1$ if $x$ is negative, and $1$ is $x$ is positive. I then used it to "re-straighten" functions that were reflected off of the $x$-axis, for example
$$y=|x|*\frac{x}{\sqrt{x^2}}$$
I refined these techniques until I came up with a function that removes values from a function that are under a supplied value $c$.
$$y=\left(\vcenter{\frac{1}{\left(\vcenter{\frac{x-c}{\sqrt{(x-c)^2}}}\right)+1}}\right)(2f(x))$$
This function is quite messy though, and I was hoping there may be a better way. If this is the best way, I would be pretty happy that I nailed this on the first try! I know that this community likes to pick apart inefficiencies in equations, so please do tell if there is a better way! Here is a desmos demonstration...
 A: That's not that messy of a function! I've seen this done with absolute values before, but never with just square roots; that's a creative yet simple way to do it. As far as I can tell, there's no way you could reduce that final function any further and still have it do what you want it to.

Edit:
There is.
Let's specifically define the clamping function to be the function by which you multiply $f(x)$ to restrict its domain, and let's give it the name $\delta(x)$. Therefore, your clamping function was $$\delta_1(x)=\vcenter{\frac{2}{\left(\vcenter{\frac{x-c}{\sqrt{(x-c)^2}}}\right)+1}}$$ After a bit of playing around, I stumbled upon a more concise one: $$\delta_2(x)=\vcenter{\frac{x-c}{\big(\sqrt{x-c}\big)^2}}$$
Notice that $\delta_2(x)$ is very similar to the key component of $\delta_1(x)$, except for one important difference: the square now comes outside the square root. Why does that matter?
Let's say that we have some function $f(x)$, and we don't want to include any values less than $x=c$ in the graph of $f(x)$. In order to do that, we're going to have to make the function undefined at every value of $x$ where $x<c$, and as far as I can tell, your question is essentially what the most concise way to do that is, while leaving the rest of $f(x)$ untouched.
In general, there are two ways to make a function undefined: division by $0$ and taking the square root of a negative number. We're going to want to use the latter method here, because that works for a range of values (the thing you take the square root of can be anything less than $0$), whereas the first method relies on the argument being exactly $0$, and we have infinitely many values of $x$ for which we want this function to be undefined.
We now know that we want to use the square root of a negative number to make our function undefined whenever $x<c$. Rearranging that inequality yields $x-c<0$, and lo and behold, we have a negative quantity of which we can take the square root. So we know we need a $\sqrt{x-c}$ in our clamping function. We also know that we need $\delta(x)$ either to equal $1$ or be undefined. If we were to square $x-c$ inside the square root, the quantity inside the square root would always be positive, no matter what $x$ and $c$ are. The solution, therefore, is to put the square outside of the square root. That way, whenever $x-c<0$, $\delta(x)$ is undefined, and whenever $x-c>0$, we can divide $x-c$ by the square of its square root to have $\delta(x)=1$. Here's a Desmos graph that shows $\delta_2(x)$ at work (though with a slightly different name, because Desmos only likes certain Greek letters, and $\delta$ is not one of them): https://www.desmos.com/calculator/fswzdkjq6s
Note 1:
The clamping function I described essentially splits $f(x)$ into a real part and an imaginary part, and then keeps only the real part. If we wanted to keep all the values where $x<c$, we would have to keep the imaginary part and discard the real part. To do that, we can just switch the order of $x$ and $c$, which is analogous to multiplying the top and bottom of $\delta(x)$ by $i^2$.
Note 2:
I was intrigued by the conversion of the absolute value function to a function of squares and square roots, so I decided to include something extra in that Desmos link: a generalization of clamping, if you will, that I refer to there as "splicing." It allows you to remove a specific portion of the graph of $f(x)$, and you can adjust both the size of the gap and the $x$-value around which the gap is centered.
Note 3:
Performing the trick of multiplying the top and bottom of a function by $i^2$ works with the splicing function as well; in that case, switching the order of $\lvert x-b\rvert$ and $a$ returns only the part of the function which you had previously "spliced" out.
