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 r98995 = a;
double r98996 = b;
double r98997 = c;
double r98998 = r98996 + r98997;
double r98999 = d;
double r99000 = r98998 + r98999;
double r99001 = r98995 * r99000;
return r99001;
}
double f(double a, double b, double c, double d) {
double r99002 = d;
double r99003 = a;
double r99004 = b;
double r99005 = c;
double r99006 = r99003 * r99005;
double r99007 = fma(r99003, r99004, r99006);
double r99008 = fma(r99002, r99003, r99007);
return r99008;
}




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