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




Bits error versus a




Bits error versus b
Results
| Original | 0.7 |
|---|---|
| Target | 0.0 |
| Herbie | 0.8 |
Initial program 0.7
rmApplied add-exp-log_binary640.7
Applied div-exp_binary640.6
Simplified0.6
Taylor expanded around 0 0.7
Simplified0.7
rmApplied add-cube-cbrt_binary640.8
Applied associate-/l*_binary640.8
Final simplification0.8
herbie shell --seed 2021173
(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))))