a \cdot \left(\left(b + c\right) + d\right)
a \cdot b + \left(c + d\right) \cdot a
double f(double a, double b, double c, double d) {
double r3646349 = a;
double r3646350 = b;
double r3646351 = c;
double r3646352 = r3646350 + r3646351;
double r3646353 = d;
double r3646354 = r3646352 + r3646353;
double r3646355 = r3646349 * r3646354;
return r3646355;
}
double f(double a, double b, double c, double d) {
double r3646356 = a;
double r3646357 = b;
double r3646358 = r3646356 * r3646357;
double r3646359 = c;
double r3646360 = d;
double r3646361 = r3646359 + r3646360;
double r3646362 = r3646361 * r3646356;
double r3646363 = r3646358 + r3646362;
return r3646363;
}




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-rgt-in0.0
rmApplied *-commutative0.0
rmApplied distribute-lft-in0.0
Applied associate-+l+0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019163
(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)))