\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r123087 = 1.0;
double r123088 = x;
double r123089 = exp(r123088);
double r123090 = r123087 + r123089;
double r123091 = log(r123090);
double r123092 = y;
double r123093 = r123088 * r123092;
double r123094 = r123091 - r123093;
return r123094;
}
double f(double x, double y) {
double r123095 = 1.0;
double r123096 = x;
double r123097 = exp(r123096);
double r123098 = r123095 + r123097;
double r123099 = log(r123098);
double r123100 = y;
double r123101 = r123096 * r123100;
double r123102 = r123099 - r123101;
return r123102;
}




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