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 r86985 = a;
double r86986 = b;
double r86987 = c;
double r86988 = r86986 + r86987;
double r86989 = d;
double r86990 = r86988 + r86989;
double r86991 = r86985 * r86990;
return r86991;
}
double f(double a, double b, double c, double d) {
double r86992 = d;
double r86993 = a;
double r86994 = b;
double r86995 = c;
double r86996 = r86993 * r86995;
double r86997 = fma(r86993, r86994, r86996);
double r86998 = fma(r86992, r86993, r86997);
return r86998;
}




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
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019354 +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)))