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 r73243 = a;
double r73244 = b;
double r73245 = c;
double r73246 = r73244 + r73245;
double r73247 = d;
double r73248 = r73246 + r73247;
double r73249 = r73243 * r73248;
return r73249;
}
double f(double a, double b, double c, double d) {
double r73250 = b;
double r73251 = c;
double r73252 = r73250 + r73251;
double r73253 = a;
double r73254 = d;
double r73255 = r73253 * r73254;
double r73256 = fma(r73252, r73253, r73255);
return r73256;
}




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