a \cdot \left(\left(b + c\right) + d\right)
b \cdot a + \left(d + c\right) \cdot a
double f(double a, double b, double c, double d) {
double r3169462 = a;
double r3169463 = b;
double r3169464 = c;
double r3169465 = r3169463 + r3169464;
double r3169466 = d;
double r3169467 = r3169465 + r3169466;
double r3169468 = r3169462 * r3169467;
return r3169468;
}
double f(double a, double b, double c, double d) {
double r3169469 = b;
double r3169470 = a;
double r3169471 = r3169469 * r3169470;
double r3169472 = d;
double r3169473 = c;
double r3169474 = r3169472 + r3169473;
double r3169475 = r3169474 * r3169470;
double r3169476 = r3169471 + r3169475;
return r3169476;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 0.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 0.0
rmApplied distribute-lft-in0.0
rmApplied distribute-rgt-in0.0
Applied associate-+l+0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019163 +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)))