a \cdot \left(\left(b + c\right) + d\right)
\mathsf{fma}\left(a, b + c, a \cdot d\right)double f(double a, double b, double c, double d) {
double r88202 = a;
double r88203 = b;
double r88204 = c;
double r88205 = r88203 + r88204;
double r88206 = d;
double r88207 = r88205 + r88206;
double r88208 = r88202 * r88207;
return r88208;
}
double f(double a, double b, double c, double d) {
double r88209 = a;
double r88210 = b;
double r88211 = c;
double r88212 = r88210 + r88211;
double r88213 = d;
double r88214 = r88209 * r88213;
double r88215 = fma(r88209, r88212, r88214);
return r88215;
}




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 distribute-lft-in0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019305 +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.0016773000000000001) (<= 0.0 d 0.0016773000000000001))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))