\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r135686 = 1.0;
double r135687 = x;
double r135688 = exp(r135687);
double r135689 = r135686 + r135688;
double r135690 = log(r135689);
double r135691 = y;
double r135692 = r135687 * r135691;
double r135693 = r135690 - r135692;
return r135693;
}
double f(double x, double y) {
double r135694 = 1.0;
double r135695 = x;
double r135696 = exp(r135695);
double r135697 = r135694 + r135696;
double r135698 = log(r135697);
double r135699 = y;
double r135700 = r135695 * r135699;
double r135701 = r135698 - r135700;
return r135701;
}




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