a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b + c, a, a \cdot d\right)double f(double a, double b, double c, double d) {
double r49882 = a;
double r49883 = b;
double r49884 = c;
double r49885 = r49883 + r49884;
double r49886 = d;
double r49887 = r49885 + r49886;
double r49888 = r49882 * r49887;
return r49888;
}
double f(double a, double b, double c, double d) {
double r49889 = b;
double r49890 = c;
double r49891 = r49889 + r49890;
double r49892 = a;
double r49893 = d;
double r49894 = r49892 * r49893;
double r49895 = fma(r49891, r49892, r49894);
return r49895;
}




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
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019209 +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)))