\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + e^{\log \left(\log \left(\sqrt{1 + e^{x}}\right)\right)}\right) - x \cdot ydouble f(double x, double y) {
double r166335 = 1.0;
double r166336 = x;
double r166337 = exp(r166336);
double r166338 = r166335 + r166337;
double r166339 = log(r166338);
double r166340 = y;
double r166341 = r166336 * r166340;
double r166342 = r166339 - r166341;
return r166342;
}
double f(double x, double y) {
double r166343 = 1.0;
double r166344 = x;
double r166345 = exp(r166344);
double r166346 = r166343 + r166345;
double r166347 = sqrt(r166346);
double r166348 = log(r166347);
double r166349 = log(r166348);
double r166350 = exp(r166349);
double r166351 = r166348 + r166350;
double r166352 = y;
double r166353 = r166344 * r166352;
double r166354 = r166351 - r166353;
return r166354;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 1.0 |
Initial program 0.5
Simplified0.5
rmApplied add-sqr-sqrt1.4
Applied log-prod1.0
rmApplied add-exp-log1.0
Final simplification1.0
herbie shell --seed 2019195
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))