\log \left(1 + e^{x}\right) - x \cdot y\log \left(\sqrt{1 + e^{x}}\right) + \left(\log \left(\sqrt{1 + e^{x}}\right) - y \cdot x\right)double f(double x, double y) {
double r6718439 = 1.0;
double r6718440 = x;
double r6718441 = exp(r6718440);
double r6718442 = r6718439 + r6718441;
double r6718443 = log(r6718442);
double r6718444 = y;
double r6718445 = r6718440 * r6718444;
double r6718446 = r6718443 - r6718445;
return r6718446;
}
double f(double x, double y) {
double r6718447 = 1.0;
double r6718448 = x;
double r6718449 = exp(r6718448);
double r6718450 = r6718447 + r6718449;
double r6718451 = sqrt(r6718450);
double r6718452 = log(r6718451);
double r6718453 = y;
double r6718454 = r6718453 * r6718448;
double r6718455 = r6718452 - r6718454;
double r6718456 = r6718452 + r6718455;
return r6718456;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 1.0 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
Applied associate--l+1.0
Final simplification1.0
herbie shell --seed 2019163
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))
(- (log (+ 1 (exp x))) (* x y)))