\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r2755638 = 1.0;
double r2755639 = x;
double r2755640 = exp(r2755639);
double r2755641 = r2755638 + r2755640;
double r2755642 = log(r2755641);
double r2755643 = y;
double r2755644 = r2755639 * r2755643;
double r2755645 = r2755642 - r2755644;
return r2755645;
}
double f(double x, double y) {
double r2755646 = 1.0;
double r2755647 = x;
double r2755648 = exp(r2755647);
double r2755649 = r2755646 + r2755648;
double r2755650 = log(r2755649);
double r2755651 = y;
double r2755652 = r2755651 * r2755647;
double r2755653 = r2755650 - r2755652;
return r2755653;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.5 |
Initial program 0.5
Final simplification0.5
herbie shell --seed 2019155
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))
(- (log (+ 1 (exp x))) (* x y)))