\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r137820 = 1.0;
double r137821 = x;
double r137822 = exp(r137821);
double r137823 = r137820 + r137822;
double r137824 = log(r137823);
double r137825 = y;
double r137826 = r137821 * r137825;
double r137827 = r137824 - r137826;
return r137827;
}
double f(double x, double y) {
double r137828 = 1.0;
double r137829 = x;
double r137830 = exp(r137829);
double r137831 = r137828 + r137830;
double r137832 = log(r137831);
double r137833 = y;
double r137834 = r137829 * r137833;
double r137835 = r137832 - r137834;
return r137835;
}




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