\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r4735018 = 1.0;
double r4735019 = x;
double r4735020 = exp(r4735019);
double r4735021 = r4735018 + r4735020;
double r4735022 = log(r4735021);
double r4735023 = y;
double r4735024 = r4735019 * r4735023;
double r4735025 = r4735022 - r4735024;
return r4735025;
}
double f(double x, double y) {
double r4735026 = 1.0;
double r4735027 = x;
double r4735028 = exp(r4735027);
double r4735029 = r4735026 + r4735028;
double r4735030 = log(r4735029);
double r4735031 = y;
double r4735032 = r4735031 * r4735027;
double r4735033 = r4735030 - r4735032;
return r4735033;
}




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 2019171
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))