\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r5859868 = 1.0;
double r5859869 = x;
double r5859870 = exp(r5859869);
double r5859871 = r5859868 + r5859870;
double r5859872 = log(r5859871);
double r5859873 = y;
double r5859874 = r5859869 * r5859873;
double r5859875 = r5859872 - r5859874;
return r5859875;
}
double f(double x, double y) {
double r5859876 = 1.0;
double r5859877 = x;
double r5859878 = exp(r5859877);
double r5859879 = r5859876 + r5859878;
double r5859880 = log(r5859879);
double r5859881 = y;
double r5859882 = r5859881 * r5859877;
double r5859883 = r5859880 - r5859882;
return r5859883;
}




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