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 r98762 = a;
double r98763 = b;
double r98764 = c;
double r98765 = r98763 + r98764;
double r98766 = d;
double r98767 = r98765 + r98766;
double r98768 = r98762 * r98767;
return r98768;
}
double f(double a, double b, double c, double d) {
double r98769 = b;
double r98770 = c;
double r98771 = r98769 + r98770;
double r98772 = a;
double r98773 = d;
double r98774 = r98773 * r98772;
double r98775 = fma(r98771, r98772, r98774);
return r98775;
}




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