\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r184400 = 1.0;
double r184401 = x;
double r184402 = exp(r184401);
double r184403 = r184400 + r184402;
double r184404 = log(r184403);
double r184405 = y;
double r184406 = r184401 * r184405;
double r184407 = r184404 - r184406;
return r184407;
}
double f(double x, double y) {
double r184408 = 1.0;
double r184409 = x;
double r184410 = exp(r184409);
double r184411 = r184408 + r184410;
double r184412 = log(r184411);
double r184413 = y;
double r184414 = r184409 * r184413;
double r184415 = r184412 - r184414;
return r184415;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 0.5
Final simplification0.5
herbie shell --seed 2020049
(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)))