\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 r3566067 = 1.0;
double r3566068 = x;
double r3566069 = exp(r3566068);
double r3566070 = r3566067 + r3566069;
double r3566071 = log(r3566070);
double r3566072 = y;
double r3566073 = r3566068 * r3566072;
double r3566074 = r3566071 - r3566073;
return r3566074;
}
double f(double x, double y) {
double r3566075 = 1.0;
double r3566076 = x;
double r3566077 = exp(r3566076);
double r3566078 = r3566075 + r3566077;
double r3566079 = sqrt(r3566078);
double r3566080 = log(r3566079);
double r3566081 = y;
double r3566082 = r3566081 * r3566076;
double r3566083 = r3566080 - r3566082;
double r3566084 = r3566080 + r3566083;
return r3566084;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| 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 2019163 +o rules:numerics
(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)))