\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\sqrt[3]{{\left(\left(d + a\right) + \left(b + c\right)\right)}^{3}} \cdot 2double f(double a, double b, double c, double d) {
double r156556 = a;
double r156557 = b;
double r156558 = c;
double r156559 = d;
double r156560 = r156558 + r156559;
double r156561 = r156557 + r156560;
double r156562 = r156556 + r156561;
double r156563 = 2.0;
double r156564 = r156562 * r156563;
return r156564;
}
double f(double a, double b, double c, double d) {
double r156565 = d;
double r156566 = a;
double r156567 = r156565 + r156566;
double r156568 = b;
double r156569 = c;
double r156570 = r156568 + r156569;
double r156571 = r156567 + r156570;
double r156572 = 3.0;
double r156573 = pow(r156571, r156572);
double r156574 = cbrt(r156573);
double r156575 = 2.0;
double r156576 = r156574 * r156575;
return r156576;
}




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 add-cbrt-cube2.9
Simplified2.9
rmApplied *-un-lft-identity2.9
Applied *-un-lft-identity2.9
Applied distribute-lft-out2.9
Simplified2.9
rmApplied associate-+r+0.6
Final simplification0.6
herbie shell --seed 2020043
(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))