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




Bits error versus a




Bits error versus b
Results
| Original | 0.7 |
|---|---|
| Target | 0.0 |
| Herbie | 1.0 |
Initial program 0.7
rmApplied add-log-exp_binary64_21630.8
Applied add-log-exp_binary64_21631.0
Applied sum-log_binary64_22151.0
Final simplification1.0
herbie shell --seed 2021098
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:herbie-target
(/ 1.0 (+ 1.0 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))