\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 r7121817 = 1.0;
double r7121818 = x;
double r7121819 = exp(r7121818);
double r7121820 = r7121817 + r7121819;
double r7121821 = log(r7121820);
double r7121822 = y;
double r7121823 = r7121818 * r7121822;
double r7121824 = r7121821 - r7121823;
return r7121824;
}
double f(double x, double y) {
double r7121825 = 1.0;
double r7121826 = x;
double r7121827 = exp(r7121826);
double r7121828 = r7121825 + r7121827;
double r7121829 = sqrt(r7121828);
double r7121830 = log(r7121829);
double r7121831 = y;
double r7121832 = r7121831 * r7121826;
double r7121833 = r7121830 - r7121832;
double r7121834 = r7121830 + r7121833;
return r7121834;
}




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