\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 r5133647 = 1.0;
double r5133648 = x;
double r5133649 = exp(r5133648);
double r5133650 = r5133647 + r5133649;
double r5133651 = log(r5133650);
double r5133652 = y;
double r5133653 = r5133648 * r5133652;
double r5133654 = r5133651 - r5133653;
return r5133654;
}
double f(double x, double y) {
double r5133655 = 1.0;
double r5133656 = x;
double r5133657 = exp(r5133656);
double r5133658 = r5133655 + r5133657;
double r5133659 = sqrt(r5133658);
double r5133660 = log(r5133659);
double r5133661 = y;
double r5133662 = r5133661 * r5133656;
double r5133663 = r5133660 - r5133662;
double r5133664 = r5133660 + r5133663;
return r5133664;
}




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 2019144
(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)))