\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r150796 = 1.0;
double r150797 = x;
double r150798 = exp(r150797);
double r150799 = r150796 + r150798;
double r150800 = log(r150799);
double r150801 = y;
double r150802 = r150797 * r150801;
double r150803 = r150800 - r150802;
return r150803;
}
double f(double x, double y) {
double r150804 = 1.0;
double r150805 = x;
double r150806 = exp(r150805);
double r150807 = r150804 + r150806;
double r150808 = log(r150807);
double r150809 = y;
double r150810 = r150805 * r150809;
double r150811 = r150808 - r150810;
return r150811;
}




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