a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(d, a, \mathsf{fma}\left(a, b, a \cdot c\right)\right)double f(double a, double b, double c, double d) {
double r92922 = a;
double r92923 = b;
double r92924 = c;
double r92925 = r92923 + r92924;
double r92926 = d;
double r92927 = r92925 + r92926;
double r92928 = r92922 * r92927;
return r92928;
}
double f(double a, double b, double c, double d) {
double r92929 = d;
double r92930 = a;
double r92931 = b;
double r92932 = c;
double r92933 = r92930 * r92932;
double r92934 = fma(r92930, r92931, r92933);
double r92935 = fma(r92929, r92930, r92934);
return r92935;
}




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 pow10.0
Applied pow10.0
Applied pow-prod-down0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020035 +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)))