\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 r160377 = 1.0;
double r160378 = x;
double r160379 = exp(r160378);
double r160380 = r160377 + r160379;
double r160381 = log(r160380);
double r160382 = y;
double r160383 = r160378 * r160382;
double r160384 = r160381 - r160383;
return r160384;
}
double f(double x, double y) {
double r160385 = 1.0;
double r160386 = x;
double r160387 = exp(r160386);
double r160388 = r160385 + r160387;
double r160389 = sqrt(r160388);
double r160390 = log(r160389);
double r160391 = r160390 + r160390;
double r160392 = y;
double r160393 = r160386 * r160392;
double r160394 = r160391 - r160393;
return r160394;
}




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