\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r130199 = 1.0;
double r130200 = x;
double r130201 = exp(r130200);
double r130202 = r130199 + r130201;
double r130203 = log(r130202);
double r130204 = y;
double r130205 = r130200 * r130204;
double r130206 = r130203 - r130205;
return r130206;
}
double f(double x, double y) {
double r130207 = 1.0;
double r130208 = x;
double r130209 = exp(r130208);
double r130210 = r130207 + r130209;
double r130211 = log(r130210);
double r130212 = y;
double r130213 = r130208 * r130212;
double r130214 = r130211 - r130213;
return r130214;
}




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