\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r184281 = 1.0;
double r184282 = x;
double r184283 = exp(r184282);
double r184284 = r184281 + r184283;
double r184285 = log(r184284);
double r184286 = y;
double r184287 = r184282 * r184286;
double r184288 = r184285 - r184287;
return r184288;
}
double f(double x, double y) {
double r184289 = 1.0;
double r184290 = x;
double r184291 = exp(r184290);
double r184292 = r184289 + r184291;
double r184293 = log(r184292);
double r184294 = y;
double r184295 = r184290 * r184294;
double r184296 = r184293 - r184295;
return r184296;
}




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