\log \left(1 + e^{x}\right) - x \cdot y\sqrt{\log \left(1 + e^{x}\right)} \cdot \sqrt{\log \left(1 + e^{x}\right)} - x \cdot ydouble f(double x, double y) {
double r163288 = 1.0;
double r163289 = x;
double r163290 = exp(r163289);
double r163291 = r163288 + r163290;
double r163292 = log(r163291);
double r163293 = y;
double r163294 = r163289 * r163293;
double r163295 = r163292 - r163294;
return r163295;
}
double f(double x, double y) {
double r163296 = 1.0;
double r163297 = x;
double r163298 = exp(r163297);
double r163299 = r163296 + r163298;
double r163300 = log(r163299);
double r163301 = sqrt(r163300);
double r163302 = r163301 * r163301;
double r163303 = y;
double r163304 = r163297 * r163303;
double r163305 = r163302 - r163304;
return r163305;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 1.1 |
Initial program 0.6
rmApplied add-sqr-sqrt1.1
Final simplification1.1
herbie shell --seed 2020060 +o rules:numerics
(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)))