\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r146540 = 1.0;
double r146541 = x;
double r146542 = exp(r146541);
double r146543 = r146540 + r146542;
double r146544 = log(r146543);
double r146545 = y;
double r146546 = r146541 * r146545;
double r146547 = r146544 - r146546;
return r146547;
}
double f(double x, double y) {
double r146548 = 1.0;
double r146549 = x;
double r146550 = exp(r146549);
double r146551 = r146548 + r146550;
double r146552 = log(r146551);
double r146553 = y;
double r146554 = r146549 * r146553;
double r146555 = r146552 - r146554;
return r146555;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.6 |
Initial program 0.6
Final simplification0.6
herbie shell --seed 2020046
(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)))