\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{1 + e^{x}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r158743 = 1.0;
double r158744 = x;
double r158745 = exp(r158744);
double r158746 = r158743 + r158745;
double r158747 = log(r158746);
double r158748 = y;
double r158749 = r158744 * r158748;
double r158750 = r158747 - r158749;
return r158750;
}
double f(double x, double y) {
double r158751 = 1.0;
double r158752 = x;
double r158753 = exp(r158752);
double r158754 = r158751 + r158753;
double r158755 = sqrt(r158754);
double r158756 = log(r158755);
double r158757 = r158756 + r158756;
double r158758 = y;
double r158759 = r158752 * r158758;
double r158760 = r158757 - r158759;
return r158760;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 1.0 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
Final simplification1.0
herbie shell --seed 2020018 +o rules:numerics
(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)))