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 r84183 = a;
double r84184 = b;
double r84185 = c;
double r84186 = r84184 + r84185;
double r84187 = d;
double r84188 = r84186 + r84187;
double r84189 = r84183 * r84188;
return r84189;
}
double f(double a, double b, double c, double d) {
double r84190 = d;
double r84191 = a;
double r84192 = b;
double r84193 = c;
double r84194 = r84191 * r84193;
double r84195 = fma(r84191, r84192, r84194);
double r84196 = fma(r84190, r84191, r84195);
return r84196;
}




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 2020001 +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)))