a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b + c, a, d \cdot a\right)double f(double a, double b, double c, double d) {
double r98766 = a;
double r98767 = b;
double r98768 = c;
double r98769 = r98767 + r98768;
double r98770 = d;
double r98771 = r98769 + r98770;
double r98772 = r98766 * r98771;
return r98772;
}
double f(double a, double b, double c, double d) {
double r98773 = b;
double r98774 = c;
double r98775 = r98773 + r98774;
double r98776 = a;
double r98777 = d;
double r98778 = r98777 * r98776;
double r98779 = fma(r98775, r98776, r98778);
return r98779;
}




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
Simplified0.0
Simplified0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019303 +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.0016773000000000001) (<= 0.0 d 0.0016773000000000001))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))