a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, \left(b + c\right), \left(d \cdot a\right)\right)double f(double a, double b, double c, double d) {
double r17874626 = a;
double r17874627 = b;
double r17874628 = c;
double r17874629 = r17874627 + r17874628;
double r17874630 = d;
double r17874631 = r17874629 + r17874630;
double r17874632 = r17874626 * r17874631;
return r17874632;
}
double f(double a, double b, double c, double d) {
double r17874633 = a;
double r17874634 = b;
double r17874635 = c;
double r17874636 = r17874634 + r17874635;
double r17874637 = d;
double r17874638 = r17874637 * r17874633;
double r17874639 = fma(r17874633, r17874636, r17874638);
return r17874639;
}




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 fma-def0.0
Final simplification0.0
herbie shell --seed 2019125 +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)))