Cootie catcher function Consider the piecewise linear function $f:[0,1]^2 \longrightarrow [0,\infty[$ given by the following plot

I was able to find the ugly expression
$$f(x,y)=\begin{cases}
a \min\{x,1-x\} + b \min\{y,1-y\}, \ |x-\tfrac{1}{2}| < |y-\tfrac{1}{2}|\\
b \min\{x,1-x\} + a \min\{y,1-y\}, \ \text{otherwise}
\end{cases},$$
(with $a= 1.8, b= 0.6$ in this case).
I'm looking for a more elegant expression for $f$ preferably without 'cases' and 'min/max'. Any ideas?
Background: I'm trying to derive a 2D orthonormal basis similar to the Haar-Wavelet which becomes a 'zigzag' when integrated.
 A: Assuming $a\geq b$, the following should work :
$$f(x,y) = \max \Big[ a \min(x,1-x) + b\min(y,1-y), b\min(x,1-x) + a \min(y,1-y)\Big]$$
A: Try the function
$$f(x,y)=1-\left|\left|x+y-1\right|-\left|y-x\right|\right|$$
that will give you a similar structure with $0$ at the minimum and $1$ at the maximum.
Why does this function work? Let's try to get the same structure but with the origin as its center (so that $f(0,0)=1$). For getting this ups and downs I started with the idea of using $||x|-|y||$. But in that case we would have $f(0,0)=0$, therefore we need a $1-$ in front of the function to get closer.
However this function will give $1$ on the diagonal where $|x|=|y|$, but we want the function to be $1$ at the coordinate axis. To get this we need to rotate our function by 45°. By doing this our coords change from $(x,y)$ to $\left(\frac{x+y}{\sqrt{2}},\frac{y-x}{\sqrt{2}}\right)$.
Now we only need to transfer everything back to the square $[0,1]^2$ instead of $[-1,1]^2$ by replacing $x$ and $y$ with $x/2-0.5$ and $y/2-0.5$ to get the final result.
Edit: By adding
$$
 c\cdot (1−|x+y−1|−|y−x|)
$$
to above function for $0<c<1$ we can reduce the size of the peaks at the edges to $c$ while maintaining the peak in the center at $1$.
A: Here is a generic function centered at the origin which can be stretched, shrunk, translated, etc. to give you what you want.
$$ f(x,y)=\min\{\,1-|x|\,,\,1-|y|\,\}+\max\{\,a(|x|-|y|)\,,\,b(|y|-|x|)\,\} $$
Here is a graph using Wolfram Alpha with $a=0.8$ and $b=0.5$.

