\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 r69639 = a;
double r69640 = b;
double r69641 = c;
double r69642 = d;
double r69643 = r69641 + r69642;
double r69644 = r69640 + r69643;
double r69645 = r69639 + r69644;
double r69646 = 2.0;
double r69647 = r69645 * r69646;
return r69647;
}
double f(double a, double b, double c, double d) {
double r69648 = 2.0;
double r69649 = b;
double r69650 = c;
double r69651 = r69649 + r69650;
double r69652 = d;
double r69653 = a;
double r69654 = r69652 + r69653;
double r69655 = r69651 + r69654;
double r69656 = r69648 * r69655;
return r69656;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.8 |
| Herbie | 0 |
Initial program 3.7
rmApplied associate-+r+2.8
rmApplied add-cbrt-cube3.0
Simplified3.0
rmApplied add-cbrt-cube3.0
Simplified3.0
rmApplied *-un-lft-identity3.0
Applied unpow-prod-down3.0
Applied cbrt-prod3.0
Applied unpow-prod-down3.0
Applied cbrt-prod3.0
Simplified3.0
Simplified0
Final simplification0
herbie shell --seed 2019198
(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))