a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b + c, a, d \cdot a\right)double f(double a, double b, double c, double d) {
double r71878 = a;
double r71879 = b;
double r71880 = c;
double r71881 = r71879 + r71880;
double r71882 = d;
double r71883 = r71881 + r71882;
double r71884 = r71878 * r71883;
return r71884;
}
double f(double a, double b, double c, double d) {
double r71885 = b;
double r71886 = c;
double r71887 = r71885 + r71886;
double r71888 = a;
double r71889 = d;
double r71890 = r71889 * r71888;
double r71891 = fma(r71887, r71888, r71890);
return r71891;
}




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
Simplified0.0
Simplified0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019323 +o rules:numerics
(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)))