\frac{e^{a}}{e^{a} + e^{b}}\sqrt{e^{a}} \cdot \frac{\sqrt{e^{a}}}{e^{a} + e^{b}}double code(double a, double b) {
return (exp(a) / (exp(a) + exp(b)));
}
double code(double a, double b) {
return (sqrt(exp(a)) * (sqrt(exp(a)) / (exp(a) + exp(b))));
}




Bits error versus a




Bits error versus b
Results
| Original | 0.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.9 |
Initial program 0.9
rmApplied *-un-lft-identity0.9
Applied add-sqr-sqrt0.9
Applied times-frac0.9
Simplified0.9
Final simplification0.9
herbie shell --seed 2020058 +o rules:numerics
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:herbie-target
(/ 1 (+ 1 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))