\log \left(1 + e^{x}\right) - x \cdot y\sqrt{\log \left(1 + e^{x}\right)} \cdot \sqrt{\log \left(1 + e^{x}\right)} - x \cdot ydouble f(double x, double y) {
double r221561 = 1.0;
double r221562 = x;
double r221563 = exp(r221562);
double r221564 = r221561 + r221563;
double r221565 = log(r221564);
double r221566 = y;
double r221567 = r221562 * r221566;
double r221568 = r221565 - r221567;
return r221568;
}
double f(double x, double y) {
double r221569 = 1.0;
double r221570 = x;
double r221571 = exp(r221570);
double r221572 = r221569 + r221571;
double r221573 = log(r221572);
double r221574 = sqrt(r221573);
double r221575 = r221574 * r221574;
double r221576 = y;
double r221577 = r221570 * r221576;
double r221578 = r221575 - r221577;
return r221578;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 1.1 |
Initial program 0.6
rmApplied add-sqr-sqrt1.1
Final simplification1.1
herbie shell --seed 2020060
(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)))