\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{1 + e^{x}}\right) + \log \left(\sqrt{1 + e^{x}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r133823 = 1.0;
double r133824 = x;
double r133825 = exp(r133824);
double r133826 = r133823 + r133825;
double r133827 = log(r133826);
double r133828 = y;
double r133829 = r133824 * r133828;
double r133830 = r133827 - r133829;
return r133830;
}
double f(double x, double y) {
double r133831 = 1.0;
double r133832 = x;
double r133833 = exp(r133832);
double r133834 = r133831 + r133833;
double r133835 = sqrt(r133834);
double r133836 = log(r133835);
double r133837 = r133836 + r133836;
double r133838 = y;
double r133839 = r133832 * r133838;
double r133840 = r133837 - r133839;
return r133840;
}




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
Final simplification1.0
herbie shell --seed 2019305
(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)))