\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{1 + e^{x}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r5134572 = 1.0;
double r5134573 = x;
double r5134574 = exp(r5134573);
double r5134575 = r5134572 + r5134574;
double r5134576 = log(r5134575);
double r5134577 = y;
double r5134578 = r5134573 * r5134577;
double r5134579 = r5134576 - r5134578;
return r5134579;
}
double f(double x, double y) {
double r5134580 = 1.0;
double r5134581 = x;
double r5134582 = exp(r5134581);
double r5134583 = r5134580 + r5134582;
double r5134584 = sqrt(r5134583);
double r5134585 = log(r5134584);
double r5134586 = r5134585 + r5134585;
double r5134587 = y;
double r5134588 = r5134581 * r5134587;
double r5134589 = r5134586 - r5134588;
return r5134589;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 1.0 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
Final simplification1.0
herbie shell --seed 2019192 +o rules:numerics
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))