I'm looking for a function $f(x_1,x_2,y)$ which has the following property.
$y \in [0,1]$, $x_1,x_2>0$.
The minimum value of $f(x_1,x_2,y)$ is $max(x_1,x_2)$ at $y=1$;
The maximum value of $f(x_1,x_2,y)$ is at $x_1+x_2$ at $y=0$;
The function should preferably use only math operations,(not functions like max,min,abs).
One example would be (using max and min) will be):
$f(x_1,x_2,y)=max(x_1,x_2)+(1-y)*min(x_1,x_2)$
For $x_1,x_2>0$ one can prove that $$\max(x_1,x_2)=\frac{x_1+x_2+\sqrt{(x_1-x_2)^2}}{2}\quad\text{and}\quad\min(x_1,x_2)=\frac{x_1+x_2-\sqrt{(x_1-x_2)^2}}{2}$$ Hence we can take a function such as $$f(x_1,x_2,y)=\frac{(2-y)(x_1+x_2)+y\sqrt{(x_1-x_2)^2}}{2}$$