\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r189416 = 1.0;
double r189417 = x;
double r189418 = exp(r189417);
double r189419 = r189416 + r189418;
double r189420 = log(r189419);
double r189421 = y;
double r189422 = r189417 * r189421;
double r189423 = r189420 - r189422;
return r189423;
}
double f(double x, double y) {
double r189424 = 1.0;
double r189425 = x;
double r189426 = exp(r189425);
double r189427 = r189424 + r189426;
double r189428 = log(r189427);
double r189429 = y;
double r189430 = r189425 * r189429;
double r189431 = r189428 - r189430;
return r189431;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
Initial program 0.6
Final simplification0.6
herbie shell --seed 2020027
(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)))