\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 r6310262 = 1.0;
double r6310263 = x;
double r6310264 = exp(r6310263);
double r6310265 = r6310262 + r6310264;
double r6310266 = log(r6310265);
double r6310267 = y;
double r6310268 = r6310263 * r6310267;
double r6310269 = r6310266 - r6310268;
return r6310269;
}
double f(double x, double y) {
double r6310270 = 1.0;
double r6310271 = x;
double r6310272 = exp(r6310271);
double r6310273 = r6310270 + r6310272;
double r6310274 = sqrt(r6310273);
double r6310275 = log(r6310274);
double r6310276 = y;
double r6310277 = r6310276 * r6310271;
double r6310278 = r6310275 - r6310277;
double r6310279 = r6310275 + r6310278;
return r6310279;
}




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