\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \left(\left(a + d\right) + \left(b + c\right)\right)
double f(double a, double b, double c, double d) {
double r66183 = a;
double r66184 = b;
double r66185 = c;
double r66186 = d;
double r66187 = r66185 + r66186;
double r66188 = r66184 + r66187;
double r66189 = r66183 + r66188;
double r66190 = 2.0;
double r66191 = r66189 * r66190;
return r66191;
}
double f(double a, double b, double c, double d) {
double r66192 = 2.0;
double r66193 = a;
double r66194 = d;
double r66195 = r66193 + r66194;
double r66196 = b;
double r66197 = c;
double r66198 = r66196 + r66197;
double r66199 = r66195 + r66198;
double r66200 = r66192 * r66199;
return r66200;
}




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 associate-+r+2.7
rmApplied add-cbrt-cube2.9
Simplified2.9
rmApplied *-un-lft-identity2.9
Applied unpow-prod-down2.9
Applied cbrt-prod2.9
Simplified2.9
Simplified0
Final simplification0
herbie shell --seed 2019212 +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))