\log \left(1 + e^{x}\right) - x \cdot y2 \cdot \log \left(\sqrt{1 + e^{x}}\right) - x \cdot ydouble f(double x, double y) {
double r95232 = 1.0;
double r95233 = x;
double r95234 = exp(r95233);
double r95235 = r95232 + r95234;
double r95236 = log(r95235);
double r95237 = y;
double r95238 = r95233 * r95237;
double r95239 = r95236 - r95238;
return r95239;
}
double f(double x, double y) {
double r95240 = 2.0;
double r95241 = 1.0;
double r95242 = x;
double r95243 = exp(r95242);
double r95244 = r95241 + r95243;
double r95245 = sqrt(r95244);
double r95246 = log(r95245);
double r95247 = r95240 * r95246;
double r95248 = y;
double r95249 = r95242 * r95248;
double r95250 = r95247 - r95249;
return r95250;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 1.1 |
Initial program 0.5
rmApplied add-sqr-sqrt1.4
Applied log-prod1.1
Final simplification1.1
herbie shell --seed 2019298
(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)))