a \cdot \left(\left(b + c\right) + d\right)
a \cdot b + a \cdot \left(c + d\right)
double f(double a, double b, double c, double d) {
double r90630 = a;
double r90631 = b;
double r90632 = c;
double r90633 = r90631 + r90632;
double r90634 = d;
double r90635 = r90633 + r90634;
double r90636 = r90630 * r90635;
return r90636;
}
double f(double a, double b, double c, double d) {
double r90637 = a;
double r90638 = b;
double r90639 = r90637 * r90638;
double r90640 = c;
double r90641 = d;
double r90642 = r90640 + r90641;
double r90643 = r90637 * r90642;
double r90644 = r90639 + r90643;
return r90644;
}




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
Applied associate-+l+0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020047
(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)))