\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{1 + e^{x}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r131994 = 1.0;
double r131995 = x;
double r131996 = exp(r131995);
double r131997 = r131994 + r131996;
double r131998 = log(r131997);
double r131999 = y;
double r132000 = r131995 * r131999;
double r132001 = r131998 - r132000;
return r132001;
}
double f(double x, double y) {
double r132002 = 1.0;
double r132003 = x;
double r132004 = exp(r132003);
double r132005 = r132002 + r132004;
double r132006 = sqrt(r132005);
double r132007 = log(r132006);
double r132008 = r132007 + r132007;
double r132009 = y;
double r132010 = r132003 * r132009;
double r132011 = r132008 - r132010;
return r132011;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 1.0 |
Initial program 0.5
Simplified0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
Final simplification1.0
herbie shell --seed 2019179
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))