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



Bits error versus a



Bits error versus b
Results
Initial program 29.4
Taylor expanded in b around 0 1.2
Simplified0.9
Applied +-commutative_binary640.9
Final simplification0.9
herbie shell --seed 2022160
(FPCore (a b)
:name "symmetry log of sum of exp"
:precision binary64
(log (+ (exp a) (exp b))))