\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + e^{\log \left(\log \left(\sqrt{1 + e^{x}}\right)\right)}\right) - x \cdot ydouble f(double x, double y) {
double r95403 = 1.0;
double r95404 = x;
double r95405 = exp(r95404);
double r95406 = r95403 + r95405;
double r95407 = log(r95406);
double r95408 = y;
double r95409 = r95404 * r95408;
double r95410 = r95407 - r95409;
return r95410;
}
double f(double x, double y) {
double r95411 = 1.0;
double r95412 = x;
double r95413 = exp(r95412);
double r95414 = r95411 + r95413;
double r95415 = sqrt(r95414);
double r95416 = log(r95415);
double r95417 = log(r95416);
double r95418 = exp(r95417);
double r95419 = r95416 + r95418;
double r95420 = y;
double r95421 = r95412 * r95420;
double r95422 = r95419 - r95421;
return r95422;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 1.0 |
Initial program 0.5
rmApplied add-sqr-sqrt1.4
Applied log-prod1.0
rmApplied add-exp-log1.0
Final simplification1.0
herbie shell --seed 2019195
(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)))