a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, d, \left(c + b\right) \cdot a\right)double f(double a, double b, double c, double d) {
double r1515615 = a;
double r1515616 = b;
double r1515617 = c;
double r1515618 = r1515616 + r1515617;
double r1515619 = d;
double r1515620 = r1515618 + r1515619;
double r1515621 = r1515615 * r1515620;
return r1515621;
}
double f(double a, double b, double c, double d) {
double r1515622 = a;
double r1515623 = d;
double r1515624 = c;
double r1515625 = b;
double r1515626 = r1515624 + r1515625;
double r1515627 = r1515626 * r1515622;
double r1515628 = fma(r1515622, r1515623, r1515627);
return r1515628;
}




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
rmApplied flip-+5.1
Applied associate-*r/5.2
Taylor expanded around -inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019151 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789 a 98765) (<= 0 b 1) (<= 0 c 0.0016773) (<= 0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))