\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 r148226 = 1.0;
double r148227 = x;
double r148228 = exp(r148227);
double r148229 = r148226 + r148228;
double r148230 = log(r148229);
double r148231 = y;
double r148232 = r148227 * r148231;
double r148233 = r148230 - r148232;
return r148233;
}
double f(double x, double y) {
double r148234 = 1.0;
double r148235 = x;
double r148236 = exp(r148235);
double r148237 = r148234 + r148236;
double r148238 = sqrt(r148237);
double r148239 = log(r148238);
double r148240 = r148239 + r148239;
double r148241 = y;
double r148242 = r148235 * r148241;
double r148243 = r148240 - r148242;
return r148243;
}




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 2019199 +o rules:numerics
(FPCore (x y)
:name "Logistic regression 2"
:herbie-target
(if (<= x 0.0) (- (log (+ 1.0 (exp x))) (* x y)) (- (log (+ 1.0 (exp (- x)))) (* (- x) (- 1.0 y))))
(- (log (+ 1.0 (exp x))) (* x y)))