\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 r157474 = 1.0;
double r157475 = x;
double r157476 = exp(r157475);
double r157477 = r157474 + r157476;
double r157478 = log(r157477);
double r157479 = y;
double r157480 = r157475 * r157479;
double r157481 = r157478 - r157480;
return r157481;
}
double f(double x, double y) {
double r157482 = 1.0;
double r157483 = x;
double r157484 = exp(r157483);
double r157485 = r157482 + r157484;
double r157486 = sqrt(r157485);
double r157487 = log(r157486);
double r157488 = r157487 + r157487;
double r157489 = y;
double r157490 = r157483 * r157489;
double r157491 = r157488 - r157490;
return r157491;
}




Bits error versus x




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