\log \left(1 + e^{x}\right) - x \cdot y2 \cdot \log \left(\sqrt{1 + e^{x}}\right) - x \cdot ydouble f(double x, double y) {
double r139302 = 1.0;
double r139303 = x;
double r139304 = exp(r139303);
double r139305 = r139302 + r139304;
double r139306 = log(r139305);
double r139307 = y;
double r139308 = r139303 * r139307;
double r139309 = r139306 - r139308;
return r139309;
}
double f(double x, double y) {
double r139310 = 2.0;
double r139311 = 1.0;
double r139312 = x;
double r139313 = exp(r139312);
double r139314 = r139311 + r139313;
double r139315 = sqrt(r139314);
double r139316 = log(r139315);
double r139317 = r139310 * r139316;
double r139318 = y;
double r139319 = r139312 * r139318;
double r139320 = r139317 - r139319;
return r139320;
}




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