\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r115659 = 1.0;
double r115660 = x;
double r115661 = exp(r115660);
double r115662 = r115659 + r115661;
double r115663 = log(r115662);
double r115664 = y;
double r115665 = r115660 * r115664;
double r115666 = r115663 - r115665;
return r115666;
}
double f(double x, double y) {
double r115667 = 1.0;
double r115668 = x;
double r115669 = exp(r115668);
double r115670 = r115667 + r115669;
double r115671 = log(r115670);
double r115672 = y;
double r115673 = r115668 * r115672;
double r115674 = r115671 - r115673;
return r115674;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.4 |
Initial program 0.4
Final simplification0.4
herbie shell --seed 2019291
(FPCore (x y)
:name "Logistic regression 2"
:precision binary64
:herbie-target
(if (<= x 0.0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))
(- (log (+ 1 (exp x))) (* x y)))