\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 r25701688 = 1.0;
double r25701689 = x;
double r25701690 = exp(r25701689);
double r25701691 = r25701688 + r25701690;
double r25701692 = log(r25701691);
double r25701693 = y;
double r25701694 = r25701689 * r25701693;
double r25701695 = r25701692 - r25701694;
return r25701695;
}
double f(double x, double y) {
double r25701696 = 1.0;
double r25701697 = x;
double r25701698 = exp(r25701697);
double r25701699 = r25701696 + r25701698;
double r25701700 = sqrt(r25701699);
double r25701701 = log(r25701700);
double r25701702 = y;
double r25701703 = r25701702 * r25701697;
double r25701704 = r25701701 - r25701703;
double r25701705 = r25701701 + r25701704;
return r25701705;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.4 |
|---|---|
| Target | 0.1 |
| Herbie | 1.0 |
Initial program 0.4
rmApplied add-sqr-sqrt1.3
Applied log-prod0.9
Applied associate--l+1.0
Final simplification1.0
herbie shell --seed 2019119
(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)))