\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r81841 = 1.0;
double r81842 = x;
double r81843 = exp(r81842);
double r81844 = r81841 + r81843;
double r81845 = log(r81844);
double r81846 = y;
double r81847 = r81842 * r81846;
double r81848 = r81845 - r81847;
return r81848;
}
double f(double x, double y) {
double r81849 = 1.0;
double r81850 = x;
double r81851 = exp(r81850);
double r81852 = r81849 + r81851;
double r81853 = log(r81852);
double r81854 = y;
double r81855 = r81850 * r81854;
double r81856 = r81853 - r81855;
return r81856;
}




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