\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{\sqrt{1 + e^{x}}} \cdot \sqrt{\sqrt{1 + e^{x}}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r111428 = 1.0;
double r111429 = x;
double r111430 = exp(r111429);
double r111431 = r111428 + r111430;
double r111432 = log(r111431);
double r111433 = y;
double r111434 = r111429 * r111433;
double r111435 = r111432 - r111434;
return r111435;
}
double f(double x, double y) {
double r111436 = 1.0;
double r111437 = x;
double r111438 = exp(r111437);
double r111439 = r111436 + r111438;
double r111440 = sqrt(r111439);
double r111441 = log(r111440);
double r111442 = sqrt(r111440);
double r111443 = r111442 * r111442;
double r111444 = log(r111443);
double r111445 = r111441 + r111444;
double r111446 = y;
double r111447 = r111437 * r111446;
double r111448 = r111445 - r111447;
return r111448;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
rmApplied add-sqr-sqrt1.0
Applied sqrt-prod0.5
Final simplification0.5
herbie shell --seed 2020034 +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)))