\log \left(1 + e^{x}\right) - x \cdot y\sqrt{\log \left(1 + e^{x}\right)} \cdot \sqrt{\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{1 + e^{x}}\right)} - x \cdot ydouble f(double x, double y) {
double r99392 = 1.0;
double r99393 = x;
double r99394 = exp(r99393);
double r99395 = r99392 + r99394;
double r99396 = log(r99395);
double r99397 = y;
double r99398 = r99393 * r99397;
double r99399 = r99396 - r99398;
return r99399;
}
double f(double x, double y) {
double r99400 = 1.0;
double r99401 = x;
double r99402 = exp(r99401);
double r99403 = r99400 + r99402;
double r99404 = log(r99403);
double r99405 = sqrt(r99404);
double r99406 = sqrt(r99403);
double r99407 = log(r99406);
double r99408 = r99407 + r99407;
double r99409 = sqrt(r99408);
double r99410 = r99405 * r99409;
double r99411 = y;
double r99412 = r99401 * r99411;
double r99413 = r99410 - r99412;
return r99413;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.4 |
Initial program 0.4
rmApplied add-sqr-sqrt0.9
rmApplied add-sqr-sqrt0.9
Applied log-prod0.4
Final simplification0.4
herbie shell --seed 2019209 +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)))