a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, b + c, d \cdot a\right)double f(double a, double b, double c, double d) {
double r4823755 = a;
double r4823756 = b;
double r4823757 = c;
double r4823758 = r4823756 + r4823757;
double r4823759 = d;
double r4823760 = r4823758 + r4823759;
double r4823761 = r4823755 * r4823760;
return r4823761;
}
double f(double a, double b, double c, double d) {
double r4823762 = a;
double r4823763 = b;
double r4823764 = c;
double r4823765 = r4823763 + r4823764;
double r4823766 = d;
double r4823767 = r4823766 * r4823762;
double r4823768 = fma(r4823762, r4823765, r4823767);
return r4823768;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-lft-in0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019168 +o rules:numerics
(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)))