\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 r131595 = 1.0;
double r131596 = x;
double r131597 = exp(r131596);
double r131598 = r131595 + r131597;
double r131599 = log(r131598);
double r131600 = y;
double r131601 = r131596 * r131600;
double r131602 = r131599 - r131601;
return r131602;
}
double f(double x, double y) {
double r131603 = 1.0;
double r131604 = x;
double r131605 = exp(r131604);
double r131606 = r131603 + r131605;
double r131607 = sqrt(r131606);
double r131608 = log(r131607);
double r131609 = r131608 + r131608;
double r131610 = y;
double r131611 = r131604 * r131610;
double r131612 = r131609 - r131611;
return r131612;
}




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