\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 r98862 = 1.0;
double r98863 = x;
double r98864 = exp(r98863);
double r98865 = r98862 + r98864;
double r98866 = log(r98865);
double r98867 = y;
double r98868 = r98863 * r98867;
double r98869 = r98866 - r98868;
return r98869;
}
double f(double x, double y) {
double r98870 = 1.0;
double r98871 = x;
double r98872 = exp(r98871);
double r98873 = r98870 + r98872;
double r98874 = sqrt(r98873);
double r98875 = log(r98874);
double r98876 = r98875 + r98875;
double r98877 = y;
double r98878 = r98871 * r98877;
double r98879 = r98876 - r98878;
return r98879;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 1.1 |
Initial program 0.5
rmApplied add-sqr-sqrt1.4
Applied log-prod1.1
Final simplification1.1
herbie shell --seed 2019212
(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)))