\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 r7065413 = 1.0;
double r7065414 = x;
double r7065415 = exp(r7065414);
double r7065416 = r7065413 + r7065415;
double r7065417 = log(r7065416);
double r7065418 = y;
double r7065419 = r7065414 * r7065418;
double r7065420 = r7065417 - r7065419;
return r7065420;
}
double f(double x, double y) {
double r7065421 = 1.0;
double r7065422 = x;
double r7065423 = exp(r7065422);
double r7065424 = r7065421 + r7065423;
double r7065425 = sqrt(r7065424);
double r7065426 = log(r7065425);
double r7065427 = y;
double r7065428 = r7065427 * r7065422;
double r7065429 = r7065426 - r7065428;
double r7065430 = r7065426 + r7065429;
return r7065430;
}




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