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 r86173 = a;
double r86174 = b;
double r86175 = c;
double r86176 = r86174 + r86175;
double r86177 = d;
double r86178 = r86176 + r86177;
double r86179 = r86173 * r86178;
return r86179;
}
double f(double a, double b, double c, double d) {
double r86180 = d;
double r86181 = a;
double r86182 = b;
double r86183 = c;
double r86184 = r86181 * r86183;
double r86185 = fma(r86181, r86182, r86184);
double r86186 = fma(r86180, r86181, r86185);
return r86186;
}




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