\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r138098 = 1.0;
double r138099 = x;
double r138100 = exp(r138099);
double r138101 = r138098 + r138100;
double r138102 = log(r138101);
double r138103 = y;
double r138104 = r138099 * r138103;
double r138105 = r138102 - r138104;
return r138105;
}
double f(double x, double y) {
double r138106 = 1.0;
double r138107 = x;
double r138108 = exp(r138107);
double r138109 = r138106 + r138108;
double r138110 = log(r138109);
double r138111 = y;
double r138112 = r138107 * r138111;
double r138113 = r138110 - r138112;
return r138113;
}




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