a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(c, a, b \cdot a + a \cdot d\right)double f(double a, double b, double c, double d) {
double r4471648 = a;
double r4471649 = b;
double r4471650 = c;
double r4471651 = r4471649 + r4471650;
double r4471652 = d;
double r4471653 = r4471651 + r4471652;
double r4471654 = r4471648 * r4471653;
return r4471654;
}
double f(double a, double b, double c, double d) {
double r4471655 = c;
double r4471656 = a;
double r4471657 = b;
double r4471658 = r4471657 * r4471656;
double r4471659 = d;
double r4471660 = r4471656 * r4471659;
double r4471661 = r4471658 + r4471660;
double r4471662 = fma(r4471655, r4471656, r4471661);
return r4471662;
}




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 add-sqr-sqrt0.5
Applied associate-*r*0.5
Taylor expanded around inf 0.0
Simplified0.0
rmApplied distribute-lft-in0.0
Final simplification0.0
herbie shell --seed 2019169 +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)))