\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\left(\left(c + b\right) + \left(d + a\right)\right) \cdot 2
double f(double a, double b, double c, double d) {
double r66732 = a;
double r66733 = b;
double r66734 = c;
double r66735 = d;
double r66736 = r66734 + r66735;
double r66737 = r66733 + r66736;
double r66738 = r66732 + r66737;
double r66739 = 2.0;
double r66740 = r66738 * r66739;
return r66740;
}
double f(double a, double b, double c, double d) {
double r66741 = c;
double r66742 = b;
double r66743 = r66741 + r66742;
double r66744 = d;
double r66745 = a;
double r66746 = r66744 + r66745;
double r66747 = r66743 + r66746;
double r66748 = 2.0;
double r66749 = r66747 * r66748;
return r66749;
}




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
Simplified3.1
rmApplied flip-+3.6
Simplified2.8
Simplified2.8
rmApplied *-un-lft-identity2.8
Applied times-frac2.7
Simplified0
Simplified0
Final simplification0
herbie shell --seed 2019179
(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))