\frac{e^{a}}{e^{a} + e^{b}}e^{a - \sqrt[3]{{\log \left(e^{a} + e^{b}\right)}^{3}}}(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
(FPCore (a b) :precision binary64 (exp (- a (cbrt (pow (log (+ (exp a) (exp b))) 3.0)))))
double code(double a, double b) {
return exp(a) / (exp(a) + exp(b));
}
double code(double a, double b) {
return exp(a - cbrt(pow(log(exp(a) + exp(b)), 3.0)));
}






Bits error versus a






Bits error versus b
Results
| Original | 0.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
| Alternative 1 | |
|---|---|
| Accuracy | 0.8 |
| Cost | 640 |
| Alternative 2 | |
|---|---|
| Accuracy | 0.8 |
| Cost | 640 |
Initial program 0.8
rmApplied add-exp-log_binary64_28440.8
Applied div-exp_binary64_28570.6
rmApplied add-cbrt-cube_binary64_28420.6
Simplified0.6
rmApplied *-un-lft-identity_binary64_28060.6
Final simplification0.6
herbie shell --seed 2020322
(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))))