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




Bits error versus a




Bits error versus b
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 0.6
rmApplied add-exp-log_binary640.6
Applied div-exp_binary640.5
Simplified0.5
rmApplied add-cbrt-cube_binary640.5
Final simplification0.5
herbie shell --seed 2021174
(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))))