\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r5413015 = 1.0;
double r5413016 = x;
double r5413017 = exp(r5413016);
double r5413018 = r5413015 + r5413017;
double r5413019 = log(r5413018);
double r5413020 = y;
double r5413021 = r5413016 * r5413020;
double r5413022 = r5413019 - r5413021;
return r5413022;
}
double f(double x, double y) {
double r5413023 = 1.0;
double r5413024 = x;
double r5413025 = exp(r5413024);
double r5413026 = r5413023 + r5413025;
double r5413027 = log(r5413026);
double r5413028 = y;
double r5413029 = r5413028 * r5413024;
double r5413030 = r5413027 - r5413029;
return r5413030;
}




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