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 r95651 = a;
double r95652 = b;
double r95653 = c;
double r95654 = r95652 + r95653;
double r95655 = d;
double r95656 = r95654 + r95655;
double r95657 = r95651 * r95656;
return r95657;
}
double f(double a, double b, double c, double d) {
double r95658 = d;
double r95659 = a;
double r95660 = b;
double r95661 = c;
double r95662 = r95659 * r95661;
double r95663 = fma(r95659, r95660, r95662);
double r95664 = fma(r95658, r95659, r95663);
return r95664;
}




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