\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r128281 = 1.0;
double r128282 = x;
double r128283 = exp(r128282);
double r128284 = r128281 + r128283;
double r128285 = log(r128284);
double r128286 = y;
double r128287 = r128282 * r128286;
double r128288 = r128285 - r128287;
return r128288;
}
double f(double x, double y) {
double r128289 = 1.0;
double r128290 = x;
double r128291 = exp(r128290);
double r128292 = r128289 + r128291;
double r128293 = log(r128292);
double r128294 = y;
double r128295 = r128290 * r128294;
double r128296 = r128293 - r128295;
return r128296;
}




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