\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 r192468 = 1.0;
double r192469 = x;
double r192470 = exp(r192469);
double r192471 = r192468 + r192470;
double r192472 = log(r192471);
double r192473 = y;
double r192474 = r192469 * r192473;
double r192475 = r192472 - r192474;
return r192475;
}
double f(double x, double y) {
double r192476 = 1.0;
double r192477 = x;
double r192478 = exp(r192477);
double r192479 = r192476 + r192478;
double r192480 = sqrt(r192479);
double r192481 = log(r192480);
double r192482 = r192481 + r192481;
double r192483 = y;
double r192484 = r192477 * r192483;
double r192485 = r192482 - r192484;
return r192485;
}




Bits error versus x




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