\log \left(e^{a} + e^{b}\right)
\begin{array}{l}
t_0 := e^{a} + 1\\
\mathsf{log1p}\left(e^{a}\right) + \left(1 + \left(0.5 - \frac{0.5}{t_0}\right) \cdot b\right) \cdot \frac{b}{t_0}
\end{array}
(FPCore (a b) :precision binary64 (log (+ (exp a) (exp b))))
(FPCore (a b) :precision binary64 (let* ((t_0 (+ (exp a) 1.0))) (+ (log1p (exp a)) (* (+ 1.0 (* (- 0.5 (/ 0.5 t_0)) b)) (/ b t_0)))))
double code(double a, double b) {
return log(exp(a) + exp(b));
}
double code(double a, double b) {
double t_0 = exp(a) + 1.0;
return log1p(exp(a)) + ((1.0 + ((0.5 - (0.5 / t_0)) * b)) * (b / t_0));
}



Bits error versus a



Bits error versus b
Results
Initial program 29.8
Taylor expanded in b around 0 1.4
Simplified1.2
Taylor expanded in a around inf 1.4
Simplified1.2
Final simplification1.2
herbie shell --seed 2022068
(FPCore (a b)
:name "symmetry log of sum of exp"
:precision binary64
(log (+ (exp a) (exp b))))