\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r17324863 = 1.0;
double r17324864 = x;
double r17324865 = exp(r17324864);
double r17324866 = r17324863 + r17324865;
double r17324867 = log(r17324866);
double r17324868 = y;
double r17324869 = r17324864 * r17324868;
double r17324870 = r17324867 - r17324869;
return r17324870;
}
double f(double x, double y) {
double r17324871 = 1.0;
double r17324872 = x;
double r17324873 = exp(r17324872);
double r17324874 = r17324871 + r17324873;
double r17324875 = log(r17324874);
double r17324876 = y;
double r17324877 = r17324876 * r17324872;
double r17324878 = r17324875 - r17324877;
return r17324878;
}




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