\log \left(1 + e^{x}\right) - x \cdot y\sqrt{\log \left(1 + e^{x}\right)} \cdot \sqrt{\log \left(1 + e^{x}\right)} - x \cdot ydouble f(double x, double y) {
double r126096 = 1.0;
double r126097 = x;
double r126098 = exp(r126097);
double r126099 = r126096 + r126098;
double r126100 = log(r126099);
double r126101 = y;
double r126102 = r126097 * r126101;
double r126103 = r126100 - r126102;
return r126103;
}
double f(double x, double y) {
double r126104 = 1.0;
double r126105 = x;
double r126106 = exp(r126105);
double r126107 = r126104 + r126106;
double r126108 = log(r126107);
double r126109 = sqrt(r126108);
double r126110 = r126109 * r126109;
double r126111 = y;
double r126112 = r126105 * r126111;
double r126113 = r126110 - r126112;
return r126113;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.6 |
|---|---|
| Target | 0.0 |
| Herbie | 1.1 |
Initial program 0.6
rmApplied add-sqr-sqrt1.1
Final simplification1.1
herbie shell --seed 2020060 +o rules:numerics
(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)))