Hint : $\displaystyle \max(f,g)=\frac{f+g+|f-g|}{2}$ and $\displaystyle \min(f,g)=\frac{f+g-|f-g|}{2}$