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




Bits error versus a




Bits error versus b
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 1.2 |
Initial program 0.6
rmApplied add-sqr-sqrt_binary641.2
Applied *-un-lft-identity_binary641.2
Applied times-frac_binary641.2
Final simplification1.2
herbie shell --seed 2020232
(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))))