\log \left(1 + e^{x}\right) - x \cdot y\mathsf{fma}\left(\sqrt{\log \left(\sqrt{1 + e^{x}}\right)}, \sqrt{\log \left(\sqrt{1 + e^{x}}\right)} + \sqrt{\log \left(\sqrt{1 + e^{x}}\right)}, -x \cdot y\right)double f(double x, double y) {
double r7109538 = 1.0;
double r7109539 = x;
double r7109540 = exp(r7109539);
double r7109541 = r7109538 + r7109540;
double r7109542 = log(r7109541);
double r7109543 = y;
double r7109544 = r7109539 * r7109543;
double r7109545 = r7109542 - r7109544;
return r7109545;
}
double f(double x, double y) {
double r7109546 = 1.0;
double r7109547 = x;
double r7109548 = exp(r7109547);
double r7109549 = r7109546 + r7109548;
double r7109550 = sqrt(r7109549);
double r7109551 = log(r7109550);
double r7109552 = sqrt(r7109551);
double r7109553 = r7109552 + r7109552;
double r7109554 = y;
double r7109555 = r7109547 * r7109554;
double r7109556 = -r7109555;
double r7109557 = fma(r7109552, r7109553, r7109556);
return r7109557;
}




Bits error versus x




Bits error versus y
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.5 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
rmApplied add-sqr-sqrt1.0
Applied add-sqr-sqrt0.5
Applied distribute-lft-out0.5
Applied fma-neg0.5
Final simplification0.5
herbie shell --seed 2019174 +o rules:numerics
(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)))