\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r157134 = 1.0;
double r157135 = x;
double r157136 = exp(r157135);
double r157137 = r157134 + r157136;
double r157138 = log(r157137);
double r157139 = y;
double r157140 = r157135 * r157139;
double r157141 = r157138 - r157140;
return r157141;
}
double f(double x, double y) {
double r157142 = 1.0;
double r157143 = x;
double r157144 = exp(r157143);
double r157145 = r157142 + r157144;
double r157146 = log(r157145);
double r157147 = y;
double r157148 = r157143 * r157147;
double r157149 = r157146 - r157148;
return r157149;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.4 |
Initial program 0.4
Final simplification0.4
herbie shell --seed 2020042
(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)))