\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 r6241543 = 1.0;
double r6241544 = x;
double r6241545 = exp(r6241544);
double r6241546 = r6241543 + r6241545;
double r6241547 = log(r6241546);
double r6241548 = y;
double r6241549 = r6241544 * r6241548;
double r6241550 = r6241547 - r6241549;
return r6241550;
}
double f(double x, double y) {
double r6241551 = 1.0;
double r6241552 = x;
double r6241553 = exp(r6241552);
double r6241554 = r6241551 + r6241553;
double r6241555 = sqrt(r6241554);
double r6241556 = log(r6241555);
double r6241557 = y;
double r6241558 = r6241557 * r6241552;
double r6241559 = r6241556 - r6241558;
double r6241560 = r6241556 + r6241559;
return r6241560;
}




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