\log \left(1 + e^{x}\right) - x \cdot y\mathsf{fma}\left(y, -x, \sqrt[3]{{\left(\log \left(e^{x} + 1\right)\right)}^{3}}\right)double f(double x, double y) {
double r111781 = 1.0;
double r111782 = x;
double r111783 = exp(r111782);
double r111784 = r111781 + r111783;
double r111785 = log(r111784);
double r111786 = y;
double r111787 = r111782 * r111786;
double r111788 = r111785 - r111787;
return r111788;
}
double f(double x, double y) {
double r111789 = y;
double r111790 = x;
double r111791 = -r111790;
double r111792 = exp(r111790);
double r111793 = 1.0;
double r111794 = r111792 + r111793;
double r111795 = log(r111794);
double r111796 = 3.0;
double r111797 = pow(r111795, r111796);
double r111798 = cbrt(r111797);
double r111799 = fma(r111789, r111791, r111798);
return r111799;
}




Bits error versus x




Bits error versus y
| Original | 0.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.6 |
Initial program 0.6
rmApplied pow10.6
Applied log-pow0.6
Applied prod-diff0.6
Simplified0.6
Simplified0.6
rmApplied add-cbrt-cube0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019325 +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)))