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 r65549 = a;
double r65550 = b;
double r65551 = c;
double r65552 = r65550 + r65551;
double r65553 = d;
double r65554 = r65552 + r65553;
double r65555 = r65549 * r65554;
return r65555;
}
double f(double a, double b, double c, double d) {
double r65556 = b;
double r65557 = c;
double r65558 = r65556 + r65557;
double r65559 = a;
double r65560 = d;
double r65561 = r65560 * r65559;
double r65562 = fma(r65558, r65559, r65561);
return r65562;
}




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 2019323 +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)))