\log \left(1 + e^{x}\right) - x \cdot y\log \left(1 + e^{x}\right) - x \cdot ydouble f(double x, double y) {
double r146525 = 1.0;
double r146526 = x;
double r146527 = exp(r146526);
double r146528 = r146525 + r146527;
double r146529 = log(r146528);
double r146530 = y;
double r146531 = r146526 * r146530;
double r146532 = r146529 - r146531;
return r146532;
}
double f(double x, double y) {
double r146533 = 1.0;
double r146534 = x;
double r146535 = exp(r146534);
double r146536 = r146533 + r146535;
double r146537 = log(r146536);
double r146538 = y;
double r146539 = r146534 * r146538;
double r146540 = r146537 - r146539;
return r146540;
}




Bits error versus x




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