a \cdot \left(\left(b + c\right) + d\right)
\left(b \cdot a + a \cdot c\right) + a \cdot d
double f(double a, double b, double c, double d) {
double r51596 = a;
double r51597 = b;
double r51598 = c;
double r51599 = r51597 + r51598;
double r51600 = d;
double r51601 = r51599 + r51600;
double r51602 = r51596 * r51601;
return r51602;
}
double f(double a, double b, double c, double d) {
double r51603 = b;
double r51604 = a;
double r51605 = r51603 * r51604;
double r51606 = c;
double r51607 = r51604 * r51606;
double r51608 = r51605 + r51607;
double r51609 = d;
double r51610 = r51604 * r51609;
double r51611 = r51608 + r51610;
return r51611;
}




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-lft-in0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019199
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))