\log \left(e^{a} + e^{b}\right)
\begin{array}{l}
t_0 := 1 + e^{a}\\
t_1 := 0.5 - \frac{0.5}{t_0}\\
\log t_0 + \left(\frac{b}{t_0} + \log \left(1 + \left(\frac{\left(b \cdot b\right) \cdot t_1}{t_0} + 0.5 \cdot \frac{{t_1}^{2} \cdot {b}^{4}}{{t_0}^{2}}\right)\right)\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 (- 0.5 (/ 0.5 t_0))))
(+
(log t_0)
(+
(/ b t_0)
(log
(+
1.0
(+
(/ (* (* b b) t_1) t_0)
(* 0.5 (/ (* (pow t_1 2.0) (pow b 4.0)) (pow t_0 2.0))))))))))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 = 0.5 - (0.5 / t_0);
return log(t_0) + ((b / t_0) + log(1.0 + ((((b * b) * t_1) / t_0) + (0.5 * ((pow(t_1, 2.0) * pow(b, 4.0)) / pow(t_0, 2.0))))));
}



Bits error versus a



Bits error versus b
Results
Initial program 30.2
Taylor expanded around 0 1.3
Simplified1.1
rmApplied add-log-exp_binary641.2
Simplified1.2
Taylor expanded around 0 1.1
Simplified1.1
Final simplification1.1
herbie shell --seed 2021204
(FPCore (a b)
:name "symmetry log of sum of exp"
:precision binary64
(log (+ (exp a) (exp b))))