\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 r170548 = 1.0;
double r170549 = x;
double r170550 = exp(r170549);
double r170551 = r170548 + r170550;
double r170552 = log(r170551);
double r170553 = y;
double r170554 = r170549 * r170553;
double r170555 = r170552 - r170554;
return r170555;
}
double f(double x, double y) {
double r170556 = 1.0;
double r170557 = x;
double r170558 = exp(r170557);
double r170559 = r170556 + r170558;
double r170560 = sqrt(r170559);
double r170561 = log(r170560);
double r170562 = r170561 + r170561;
double r170563 = y;
double r170564 = r170557 * r170563;
double r170565 = r170562 - r170564;
return r170565;
}




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