Can we Clamp and Clip numbers mathematically? While programming I came up with a the following equation / workflow
clampValue = (value - minValueofRange) / (maxValueofRange - minValueofRange);
clippedValue = min(1, max(0, clampValue));
finalValue = clippedValue * scale;

Now the clipping ultimately causes an if and else in programming. Can we convert it completely to a mathematical equation?
Edit:
max and min are functions in c++ defined like:
int max(int v1, int v2){
    if(v1 > v2) return v1;
    else return v2;
}

Similar for the min() function

I assume that you are after a branchless expression (otherwise you can stick to the $\min/\max$ definition).
I don't think there is anything in the floating-point mathematical functions that can help you. There are indeed built-in functions such as $\min$, $\max$ and $\text{abs}$ that you can use, but you don't know if they are implemented in a branchless way.
If you are looking for "by all means" optimization, you can hack into the floating-point representation and play with the sign bit, which is the most significant one.
For instance, in C, using a union with { int i; float f; }, the expression ~(i >> 31) & i implements the clamping of the negatives, $\max(0, f)$.
