\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r153339 = 1.0;
double r153340 = x;
double r153341 = exp(r153340);
double r153342 = r153339 + r153341;
double r153343 = log(r153342);
double r153344 = y;
double r153345 = r153340 * r153344;
double r153346 = r153343 - r153345;
return r153346;
}
double f(double x, double y) {
double r153347 = 1.0;
double r153348 = x;
double r153349 = exp(r153348);
double r153350 = r153347 + r153349;
double r153351 = log(r153350);
double r153352 = y;
double r153353 = r153348 * r153352;
double r153354 = r153351 - r153353;
return r153354;
}




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