\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - y \cdot xdouble f(double x, double y) {
double r6233751 = 1.0;
double r6233752 = x;
double r6233753 = exp(r6233752);
double r6233754 = r6233751 + r6233753;
double r6233755 = log(r6233754);
double r6233756 = y;
double r6233757 = r6233752 * r6233756;
double r6233758 = r6233755 - r6233757;
return r6233758;
}
double f(double x, double y) {
double r6233759 = 1.0;
double r6233760 = x;
double r6233761 = exp(r6233760);
double r6233762 = r6233759 + r6233761;
double r6233763 = log(r6233762);
double r6233764 = y;
double r6233765 = r6233764 * r6233760;
double r6233766 = r6233763 - r6233765;
return r6233766;
}




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 2019172
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))