\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r7283381 = 1.0;
double r7283382 = x;
double r7283383 = exp(r7283382);
double r7283384 = r7283381 + r7283383;
double r7283385 = log(r7283384);
double r7283386 = y;
double r7283387 = r7283382 * r7283386;
double r7283388 = r7283385 - r7283387;
return r7283388;
}
double f(double x, double y) {
double r7283389 = 1.0;
double r7283390 = x;
double r7283391 = exp(r7283390);
double r7283392 = r7283389 + r7283391;
double r7283393 = log(r7283392);
double r7283394 = y;
double r7283395 = r7283394 * r7283390;
double r7283396 = r7283393 - r7283395;
return r7283396;
}




Bits error versus x




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