\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r187546 = 1.0;
double r187547 = x;
double r187548 = exp(r187547);
double r187549 = r187546 + r187548;
double r187550 = log(r187549);
double r187551 = y;
double r187552 = r187547 * r187551;
double r187553 = r187550 - r187552;
return r187553;
}
double f(double x, double y) {
double r187554 = 1.0;
double r187555 = x;
double r187556 = exp(r187555);
double r187557 = r187554 + r187556;
double r187558 = log(r187557);
double r187559 = y;
double r187560 = r187555 * r187559;
double r187561 = r187558 - r187560;
return r187561;
}




Bits error versus x




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