a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, d + b, c \cdot a\right)double f(double a, double b, double c, double d) {
double r93362 = a;
double r93363 = b;
double r93364 = c;
double r93365 = r93363 + r93364;
double r93366 = d;
double r93367 = r93365 + r93366;
double r93368 = r93362 * r93367;
return r93368;
}
double f(double a, double b, double c, double d) {
double r93369 = a;
double r93370 = d;
double r93371 = b;
double r93372 = r93370 + r93371;
double r93373 = c;
double r93374 = r93373 * r93369;
double r93375 = fma(r93369, r93372, r93374);
return r93375;
}




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
Simplified0.0
rmApplied add-sqr-sqrt0.5
Applied associate-*r*0.6
Simplified0.6
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))