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 r82228 = a;
double r82229 = b;
double r82230 = c;
double r82231 = r82229 + r82230;
double r82232 = d;
double r82233 = r82231 + r82232;
double r82234 = r82228 * r82233;
return r82234;
}
double f(double a, double b, double c, double d) {
double r82235 = d;
double r82236 = a;
double r82237 = b;
double r82238 = c;
double r82239 = r82236 * r82238;
double r82240 = fma(r82236, r82237, r82239);
double r82241 = fma(r82235, r82236, r82240);
return r82241;
}




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 pow10.0
Applied pow10.0
Applied pow-prod-down0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020025 +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)))