It's well-known that $$\max(a,b)=\frac{a+b+|a-b|}{2}.$$
Is there a (good) generalization to several variables? Of course $\max(a,b,c)=\max(a,\max(b,c))$ and so $$\max(a,b,c)=\frac{a+\frac{b+c+|b-c|}{2}+|a-\frac{b+c+|b-c|}{2}|}{2}$$ $$=\frac{a+0.5b+0.5c+0.5\left|b-c|+|a-0.5b-0.5c-0.5|b-c|\right|}{2}$$ but I'd like a form that shows the natural symmetry better and which doesn't have so many operations.
This is a practical problem working on a system which has an absolute value operator but no maximum and not much ability to execute conditional statements, but to be honest the real reason I'm interedted is an attempt to beautify something that is seemingly ugly.
For the practical side I need 5-10 arguments and it's acceptable to assume that all arguments are at least 0, though of course it would be much more satisfying if this latter assumption was not needed.