As I work on Herbie, my numerical analysis assistant, I'm always thinking about how I could teach it classic numerical analysis tricks. Recently, my student Oliver Flatt and I have been thinking about tricks for symmetric expressions. Symmetry for Accuracy Consider the following computation, which is important in statistics: \[ \log(e^a + e^b) \] The numerical analysis wisdom is that this expression is best evaluated via the expression max(a, b) + log1p(exp(min(a, b) - max(a, b))) There's a l...