a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(d, a, \mathsf{fma}\left(a, b, a \cdot c\right)\right)double f(double a, double b, double c, double d) {
double r82529 = a;
double r82530 = b;
double r82531 = c;
double r82532 = r82530 + r82531;
double r82533 = d;
double r82534 = r82532 + r82533;
double r82535 = r82529 * r82534;
return r82535;
}
double f(double a, double b, double c, double d) {
double r82536 = d;
double r82537 = a;
double r82538 = b;
double r82539 = c;
double r82540 = r82537 * r82539;
double r82541 = fma(r82537, r82538, r82540);
double r82542 = fma(r82536, r82537, r82541);
return r82542;
}




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
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020056 +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)))