\log \left(e^{a} + e^{b}\right)
\mathsf{log1p}\left(e^{a}\right) + \frac{b}{e^{a} + 1}
(FPCore (a b) :precision binary64 (log (+ (exp a) (exp b))))
(FPCore (a b) :precision binary64 (+ (log1p (exp a)) (/ b (+ (exp a) 1.0))))
double code(double a, double b) {
return log(exp(a) + exp(b));
}
double code(double a, double b) {
return log1p(exp(a)) + (b / (exp(a) + 1.0));
}



Bits error versus a



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