a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(b + c, a, a \cdot d\right)double f(double a, double b, double c, double d) {
double r62823 = a;
double r62824 = b;
double r62825 = c;
double r62826 = r62824 + r62825;
double r62827 = d;
double r62828 = r62826 + r62827;
double r62829 = r62823 * r62828;
return r62829;
}
double f(double a, double b, double c, double d) {
double r62830 = b;
double r62831 = c;
double r62832 = r62830 + r62831;
double r62833 = a;
double r62834 = d;
double r62835 = r62833 * r62834;
double r62836 = fma(r62832, r62833, r62835);
return r62836;
}




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