\frac{e^{a}}{e^{a} + e^{b}}\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}double code(double a, double b) {
return (exp(a) / (exp(a) + exp(b)));
}
double code(double a, double b) {
return (1.0 / ((exp(a) + exp(b)) / exp(a)));
}




Bits error versus a




Bits error versus b
Results
| Original | 0.7 |
|---|---|
| Target | 0.0 |
| Herbie | 0.7 |
Initial program 0.7
rmApplied clear-num0.7
Final simplification0.7
herbie shell --seed 2020106
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:herbie-target
(/ 1 (+ 1 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))