\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r3887776 = 1.0;
double r3887777 = x;
double r3887778 = exp(r3887777);
double r3887779 = r3887776 + r3887778;
double r3887780 = log(r3887779);
double r3887781 = y;
double r3887782 = r3887777 * r3887781;
double r3887783 = r3887780 - r3887782;
return r3887783;
}
double f(double x, double y) {
double r3887784 = 1.0;
double r3887785 = x;
double r3887786 = exp(r3887785);
double r3887787 = r3887784 + r3887786;
double r3887788 = log(r3887787);
double r3887789 = y;
double r3887790 = r3887789 * r3887785;
double r3887791 = r3887788 - r3887790;
return r3887791;
}




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 2019135
(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)))