\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r125155 = 1.0;
double r125156 = x;
double r125157 = exp(r125156);
double r125158 = r125155 + r125157;
double r125159 = log(r125158);
double r125160 = y;
double r125161 = r125156 * r125160;
double r125162 = r125159 - r125161;
return r125162;
}
double f(double x, double y) {
double r125163 = 1.0;
double r125164 = x;
double r125165 = exp(r125164);
double r125166 = r125163 + r125165;
double r125167 = log(r125166);
double r125168 = y;
double r125169 = r125164 * r125168;
double r125170 = r125167 - r125169;
return r125170;
}




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