a \cdot \left(\left(b + c\right) + d\right)
\left(b + c\right) \cdot a + d \cdot a
double f(double a, double b, double c, double d) {
double r70585 = a;
double r70586 = b;
double r70587 = c;
double r70588 = r70586 + r70587;
double r70589 = d;
double r70590 = r70588 + r70589;
double r70591 = r70585 * r70590;
return r70591;
}
double f(double a, double b, double c, double d) {
double r70592 = b;
double r70593 = c;
double r70594 = r70592 + r70593;
double r70595 = a;
double r70596 = r70594 * r70595;
double r70597 = d;
double r70598 = r70597 * r70595;
double r70599 = r70596 + r70598;
return r70599;
}




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
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019325
(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)))