\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r5037704 = 1.0;
double r5037705 = x;
double r5037706 = exp(r5037705);
double r5037707 = r5037704 + r5037706;
double r5037708 = log(r5037707);
double r5037709 = y;
double r5037710 = r5037705 * r5037709;
double r5037711 = r5037708 - r5037710;
return r5037711;
}
double f(double x, double y) {
double r5037712 = 1.0;
double r5037713 = x;
double r5037714 = exp(r5037713);
double r5037715 = r5037712 + r5037714;
double r5037716 = log(r5037715);
double r5037717 = y;
double r5037718 = r5037717 * r5037713;
double r5037719 = r5037716 - r5037718;
return r5037719;
}




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