\frac{e^{a}}{e^{a} + e^{b}}{e}^{\left(a - \log \left(e^{a} + e^{b}\right)\right)}double f(double a, double b) {
double r27823506 = a;
double r27823507 = exp(r27823506);
double r27823508 = b;
double r27823509 = exp(r27823508);
double r27823510 = r27823507 + r27823509;
double r27823511 = r27823507 / r27823510;
return r27823511;
}
double f(double a, double b) {
double r27823512 = exp(1.0);
double r27823513 = a;
double r27823514 = exp(r27823513);
double r27823515 = b;
double r27823516 = exp(r27823515);
double r27823517 = r27823514 + r27823516;
double r27823518 = log(r27823517);
double r27823519 = r27823513 - r27823518;
double r27823520 = pow(r27823512, r27823519);
return r27823520;
}




Bits error versus a




Bits error versus b
Results
| Original | 0.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.7 |
Initial program 0.8
rmApplied add-exp-log0.8
Applied div-exp0.7
rmApplied *-un-lft-identity0.7
Applied *-un-lft-identity0.7
Applied distribute-lft-out--0.7
Applied exp-prod0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2019124
(FPCore (a b)
:name "Quotient of sum of exps"
:herbie-target
(/ 1 (+ 1 (exp (- b a))))
(/ (exp a) (+ (exp a) (exp b))))