\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 r5595435 = 1.0;
double r5595436 = x;
double r5595437 = exp(r5595436);
double r5595438 = r5595435 + r5595437;
double r5595439 = log(r5595438);
double r5595440 = y;
double r5595441 = r5595436 * r5595440;
double r5595442 = r5595439 - r5595441;
return r5595442;
}
double f(double x, double y) {
double r5595443 = 1.0;
double r5595444 = x;
double r5595445 = exp(r5595444);
double r5595446 = r5595443 + r5595445;
double r5595447 = sqrt(r5595446);
double r5595448 = log(r5595447);
double r5595449 = y;
double r5595450 = r5595449 * r5595444;
double r5595451 = r5595448 - r5595450;
double r5595452 = r5595448 + r5595451;
return r5595452;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| 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 2019163 +o rules:numerics
(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)))