\log \left(1 + e^{x}\right) - x \cdot y\log \left(\sqrt{1 + e^{x}}\right) + \left(\log \left(\sqrt{1 + e^{x}}\right) - x \cdot y\right)double f(double x, double y) {
double r208961 = 1.0;
double r208962 = x;
double r208963 = exp(r208962);
double r208964 = r208961 + r208963;
double r208965 = log(r208964);
double r208966 = y;
double r208967 = r208962 * r208966;
double r208968 = r208965 - r208967;
return r208968;
}
double f(double x, double y) {
double r208969 = 1.0;
double r208970 = x;
double r208971 = exp(r208970);
double r208972 = r208969 + r208971;
double r208973 = sqrt(r208972);
double r208974 = log(r208973);
double r208975 = y;
double r208976 = r208970 * r208975;
double r208977 = r208974 - r208976;
double r208978 = r208974 + r208977;
return r208978;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.1 |
| Herbie | 1.1 |
Initial program 0.6
rmApplied add-sqr-sqrt1.4
Applied log-prod1.1
Applied associate--l+1.1
Final simplification1.1
herbie shell --seed 2020036
(FPCore (x y)
:name "Logistic regression 2"
:precision binary64
:herbie-target
(if (<= x 0.0) (- (log (+ 1 (exp x))) (* x y)) (- (log (+ 1 (exp (- x)))) (* (- x) (- 1 y))))
(- (log (+ 1 (exp x))) (* x y)))