\frac{e^{a}}{e^{a} + e^{b}}e^{a} \cdot \frac{1}{e^{b} + e^{a}}double f(double a, double b) {
double r130192 = a;
double r130193 = exp(r130192);
double r130194 = b;
double r130195 = exp(r130194);
double r130196 = r130193 + r130195;
double r130197 = r130193 / r130196;
return r130197;
}
double f(double a, double b) {
double r130198 = a;
double r130199 = exp(r130198);
double r130200 = 1.0;
double r130201 = b;
double r130202 = exp(r130201);
double r130203 = r130202 + r130199;
double r130204 = r130200 / r130203;
double r130205 = r130199 * r130204;
return r130205;
}




Bits error versus a




Bits error versus b
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
Initial program 0.6
rmApplied add-exp-log0.6
Applied div-exp0.5
rmApplied sub-neg0.5
Applied exp-sum0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019323
(FPCore (a b)
:name "Quotient of sum of exps"
:precision binary64
:herbie-target
(/ 1 (+ 1 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))