\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r22607296 = 1.0;
double r22607297 = x;
double r22607298 = exp(r22607297);
double r22607299 = r22607296 + r22607298;
double r22607300 = log(r22607299);
double r22607301 = y;
double r22607302 = r22607297 * r22607301;
double r22607303 = r22607300 - r22607302;
return r22607303;
}
double f(double x, double y) {
double r22607304 = 1.0;
double r22607305 = x;
double r22607306 = exp(r22607305);
double r22607307 = r22607304 + r22607306;
double r22607308 = log(r22607307);
double r22607309 = y;
double r22607310 = r22607309 * r22607305;
double r22607311 = r22607308 - r22607310;
return r22607311;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.4 |
Initial program 0.4
Final simplification0.4
herbie shell --seed 2019104
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))
(- (log (+ 1 (exp x))) (* x y)))