\log \left(1 + e^{x}\right) - x \cdot y\log \left(\sqrt{1 + e^{x}}\right) + \left(\log \left(\sqrt{1 + e^{x}}\right) - y \cdot x\right)double f(double x, double y) {
double r28651279 = 1.0;
double r28651280 = x;
double r28651281 = exp(r28651280);
double r28651282 = r28651279 + r28651281;
double r28651283 = log(r28651282);
double r28651284 = y;
double r28651285 = r28651280 * r28651284;
double r28651286 = r28651283 - r28651285;
return r28651286;
}
double f(double x, double y) {
double r28651287 = 1.0;
double r28651288 = x;
double r28651289 = exp(r28651288);
double r28651290 = r28651287 + r28651289;
double r28651291 = sqrt(r28651290);
double r28651292 = log(r28651291);
double r28651293 = y;
double r28651294 = r28651293 * r28651288;
double r28651295 = r28651292 - r28651294;
double r28651296 = r28651292 + r28651295;
return r28651296;
}




Bits error versus x




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