\frac{e^{a}}{e^{a} + e^{b}}\frac{1}{1 + e^{b - a}}double f(double a, double b) {
double r110750 = a;
double r110751 = exp(r110750);
double r110752 = b;
double r110753 = exp(r110752);
double r110754 = r110751 + r110753;
double r110755 = r110751 / r110754;
return r110755;
}
double f(double a, double b) {
double r110756 = 1.0;
double r110757 = b;
double r110758 = a;
double r110759 = r110757 - r110758;
double r110760 = exp(r110759);
double r110761 = r110756 + r110760;
double r110762 = r110756 / r110761;
return r110762;
}




Bits error versus a




Bits error versus b
Results
| Original | 0.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.8
rmApplied clear-num0.8
Simplified0.8
rmApplied clear-num0.8
Simplified0.0
Final simplification0.0
herbie shell --seed 2019304
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:herbie-target
(/ 1 (+ 1 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))