a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, b + c, a \cdot d\right)double f(double a, double b, double c, double d) {
double r76927 = a;
double r76928 = b;
double r76929 = c;
double r76930 = r76928 + r76929;
double r76931 = d;
double r76932 = r76930 + r76931;
double r76933 = r76927 * r76932;
return r76933;
}
double f(double a, double b, double c, double d) {
double r76934 = a;
double r76935 = b;
double r76936 = c;
double r76937 = r76935 + r76936;
double r76938 = d;
double r76939 = r76934 * r76938;
double r76940 = fma(r76934, r76937, r76939);
return r76940;
}




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 2019235 +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.0016773000000000001) (<= 0.0 d 0.0016773000000000001))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))