\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\mathsf{log1p}\left(\sqrt[3]{{\left(\mathsf{expm1}\left(\left(d + a\right) + \left(b + c\right)\right)\right)}^{3}}\right) \cdot 2double f(double a, double b, double c, double d) {
double r118262 = a;
double r118263 = b;
double r118264 = c;
double r118265 = d;
double r118266 = r118264 + r118265;
double r118267 = r118263 + r118266;
double r118268 = r118262 + r118267;
double r118269 = 2.0;
double r118270 = r118268 * r118269;
return r118270;
}
double f(double a, double b, double c, double d) {
double r118271 = d;
double r118272 = a;
double r118273 = r118271 + r118272;
double r118274 = b;
double r118275 = c;
double r118276 = r118274 + r118275;
double r118277 = r118273 + r118276;
double r118278 = expm1(r118277);
double r118279 = 3.0;
double r118280 = pow(r118278, r118279);
double r118281 = cbrt(r118280);
double r118282 = log1p(r118281);
double r118283 = 2.0;
double r118284 = r118282 * r118283;
return r118284;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.9 |
| Herbie | 0.6 |
Initial program 3.7
rmApplied associate-+r+2.8
rmApplied log1p-expm1-u2.8
rmApplied add-cbrt-cube2.9
Simplified2.9
rmApplied associate-+r+0.6
Final simplification0.6
herbie shell --seed 2019356 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p6"
:precision binary64
:pre (and (<= -14 a -13) (<= -3 b -2) (<= 3 c 3.5) (<= 12.5 d 13.5))
:herbie-target
(+ (* (+ a b) 2) (* (+ c d) 2))
(* (+ a (+ b (+ c d))) 2))