\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r229804 = 1.0;
double r229805 = x;
double r229806 = exp(r229805);
double r229807 = r229804 + r229806;
double r229808 = log(r229807);
double r229809 = y;
double r229810 = r229805 * r229809;
double r229811 = r229808 - r229810;
return r229811;
}
double f(double x, double y) {
double r229812 = 1.0;
double r229813 = x;
double r229814 = exp(r229813);
double r229815 = r229812 + r229814;
double r229816 = log(r229815);
double r229817 = y;
double r229818 = r229813 * r229817;
double r229819 = r229816 - r229818;
return r229819;
}




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