\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r3996321 = 1.0;
double r3996322 = x;
double r3996323 = exp(r3996322);
double r3996324 = r3996321 + r3996323;
double r3996325 = log(r3996324);
double r3996326 = y;
double r3996327 = r3996322 * r3996326;
double r3996328 = r3996325 - r3996327;
return r3996328;
}
double f(double x, double y) {
double r3996329 = 1.0;
double r3996330 = x;
double r3996331 = exp(r3996330);
double r3996332 = r3996329 + r3996331;
double r3996333 = log(r3996332);
double r3996334 = y;
double r3996335 = r3996334 * r3996330;
double r3996336 = r3996333 - r3996335;
return r3996336;
}




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