\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r194876 = 1.0;
double r194877 = x;
double r194878 = exp(r194877);
double r194879 = r194876 + r194878;
double r194880 = log(r194879);
double r194881 = y;
double r194882 = r194877 * r194881;
double r194883 = r194880 - r194882;
return r194883;
}
double f(double x, double y) {
double r194884 = 1.0;
double r194885 = x;
double r194886 = exp(r194885);
double r194887 = r194884 + r194886;
double r194888 = log(r194887);
double r194889 = y;
double r194890 = r194885 * r194889;
double r194891 = r194888 - r194890;
return r194891;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 0.5
Final simplification0.5
herbie shell --seed 2019362
(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)))