\log \left(1 + e^{x}\right) - x \cdot y\left(\log \left(\sqrt{\sqrt{1 + e^{x}}} \cdot \sqrt{\sqrt{1 + e^{x}}}\right) + \log \left(\sqrt{1 + e^{x}}\right)\right) - x \cdot ydouble f(double x, double y) {
double r158222 = 1.0;
double r158223 = x;
double r158224 = exp(r158223);
double r158225 = r158222 + r158224;
double r158226 = log(r158225);
double r158227 = y;
double r158228 = r158223 * r158227;
double r158229 = r158226 - r158228;
return r158229;
}
double f(double x, double y) {
double r158230 = 1.0;
double r158231 = x;
double r158232 = exp(r158231);
double r158233 = r158230 + r158232;
double r158234 = sqrt(r158233);
double r158235 = sqrt(r158234);
double r158236 = r158235 * r158235;
double r158237 = log(r158236);
double r158238 = log(r158234);
double r158239 = r158237 + r158238;
double r158240 = y;
double r158241 = r158231 * r158240;
double r158242 = r158239 - r158241;
return r158242;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
Initial program 0.5
rmApplied add-sqr-sqrt1.3
Applied log-prod1.0
rmApplied add-sqr-sqrt1.0
Applied sqrt-prod0.5
Final simplification0.5
herbie shell --seed 2020034
(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)))