A few years ago I derived the following formula which I just came across in my notes:
$$\min(x,y)=\log\left(\frac{e^x+e^y}{1+e^{|x-y|}}\right)=y+\log\left(\frac{1+e^{x-y}}{1+e^{|x-y|}}\right).$$
Has anyone seen this before, and if so is there a reference? There is also a version for $\max$,
$$\max(x,y)=\log \left(\frac{e^x+e^y}{1+e^{-\left| x-y\right| }}\right).$$
At the time (rightly or wrongly!) I thought maybe it might shed light on "$\min$" and "$\max$" analogies for complex numbers, but apart from producing a new complex number (different to $x$ and $y$) it didn't yield much. Still I'd not seen this before so thought it might be of interest... Works perfectly for the reals.
UPDATE
Apparently this is related to the Softmax function.