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 r85103 = a;
double r85104 = b;
double r85105 = c;
double r85106 = r85104 + r85105;
double r85107 = d;
double r85108 = r85106 + r85107;
double r85109 = r85103 * r85108;
return r85109;
}
double f(double a, double b, double c, double d) {
double r85110 = d;
double r85111 = a;
double r85112 = b;
double r85113 = c;
double r85114 = r85111 * r85113;
double r85115 = fma(r85111, r85112, r85114);
double r85116 = fma(r85110, r85111, r85115);
return r85116;
}




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