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 r47492 = a;
double r47493 = b;
double r47494 = c;
double r47495 = r47493 + r47494;
double r47496 = d;
double r47497 = r47495 + r47496;
double r47498 = r47492 * r47497;
return r47498;
}
double f(double a, double b, double c, double d) {
double r47499 = b;
double r47500 = c;
double r47501 = r47499 + r47500;
double r47502 = a;
double r47503 = d;
double r47504 = r47503 * r47502;
double r47505 = fma(r47501, r47502, r47504);
return r47505;
}




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