a \cdot \left(\left(b + c\right) + d\right)
d \cdot a + (b \cdot a + \left(c \cdot a\right))_*
double f(double a, double b, double c, double d) {
double r7784250 = a;
double r7784251 = b;
double r7784252 = c;
double r7784253 = r7784251 + r7784252;
double r7784254 = d;
double r7784255 = r7784253 + r7784254;
double r7784256 = r7784250 * r7784255;
return r7784256;
}
double f(double a, double b, double c, double d) {
double r7784257 = d;
double r7784258 = a;
double r7784259 = r7784257 * r7784258;
double r7784260 = b;
double r7784261 = c;
double r7784262 = r7784261 * r7784258;
double r7784263 = fma(r7784260, r7784258, r7784262);
double r7784264 = r7784259 + r7784263;
return r7784264;
}




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 distribute-rgt-in0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019119 +o rules:numerics
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789 a 98765) (<= 0 b 1) (<= 0 c 0.0016773) (<= 0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))