\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \left(\left(b + c\right) + \left(d + a\right)\right)
double f(double a, double b, double c, double d) {
double r60639 = a;
double r60640 = b;
double r60641 = c;
double r60642 = d;
double r60643 = r60641 + r60642;
double r60644 = r60640 + r60643;
double r60645 = r60639 + r60644;
double r60646 = 2.0;
double r60647 = r60645 * r60646;
return r60647;
}
double f(double a, double b, double c, double d) {
double r60648 = 2.0;
double r60649 = b;
double r60650 = c;
double r60651 = r60649 + r60650;
double r60652 = d;
double r60653 = a;
double r60654 = r60652 + r60653;
double r60655 = r60651 + r60654;
double r60656 = r60648 * r60655;
return r60656;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.6 |
|---|---|
| Target | 3.8 |
| Herbie | 0 |
Initial program 3.6
rmApplied associate-+r+2.7
rmApplied add-cbrt-cube2.9
Simplified2.9
rmApplied add-cbrt-cube2.9
Simplified2.9
rmApplied *-un-lft-identity2.9
Applied unpow-prod-down2.9
Applied cbrt-prod2.9
Applied unpow-prod-down2.9
Applied cbrt-prod2.9
Simplified2.9
Simplified0
Final simplification0
herbie shell --seed 2019199
(FPCore (a b c d)
:name "Expression, p6"
:pre (and (<= -14.0 a -13.0) (<= -3.0 b -2.0) (<= 3.0 c 3.5) (<= 12.5 d 13.5))
:herbie-target
(+ (* (+ a b) 2.0) (* (+ c d) 2.0))
(* (+ a (+ b (+ c d))) 2.0))