\log \left(1 + e^{x}\right) - x \cdot y2 \cdot \log \left(\sqrt{1 + e^{x}}\right) - x \cdot ydouble f(double x, double y) {
double r133958 = 1.0;
double r133959 = x;
double r133960 = exp(r133959);
double r133961 = r133958 + r133960;
double r133962 = log(r133961);
double r133963 = y;
double r133964 = r133959 * r133963;
double r133965 = r133962 - r133964;
return r133965;
}
double f(double x, double y) {
double r133966 = 2.0;
double r133967 = 1.0;
double r133968 = x;
double r133969 = exp(r133968);
double r133970 = r133967 + r133969;
double r133971 = sqrt(r133970);
double r133972 = log(r133971);
double r133973 = r133966 * r133972;
double r133974 = y;
double r133975 = r133968 * r133974;
double r133976 = r133973 - r133975;
return r133976;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.1 |
| Herbie | 1.1 |
Initial program 0.5
rmApplied add-sqr-sqrt1.4
Applied log-prod1.1
Applied associate--l+1.1
Final simplification1.1
herbie shell --seed 2019294
(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)))