a \cdot \left(\left(b + c\right) + d\right)
b \cdot a + a \cdot \left(c + d\right)
double f(double a, double b, double c, double d) {
double r108028 = a;
double r108029 = b;
double r108030 = c;
double r108031 = r108029 + r108030;
double r108032 = d;
double r108033 = r108031 + r108032;
double r108034 = r108028 * r108033;
return r108034;
}
double f(double a, double b, double c, double d) {
double r108035 = b;
double r108036 = a;
double r108037 = r108035 * r108036;
double r108038 = c;
double r108039 = d;
double r108040 = r108038 + r108039;
double r108041 = r108036 * r108040;
double r108042 = r108037 + r108041;
return r108042;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-lft-in0.0
rmApplied distribute-rgt-in0.0
Applied associate-+l+0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020027
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (<= 56789 a 98765) (<= 0.0 b 1) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))