a \cdot \left(\left(b + c\right) + d\right)
a \cdot b + \left(d + c\right) \cdot a
double f(double a, double b, double c, double d) {
double r5746345 = a;
double r5746346 = b;
double r5746347 = c;
double r5746348 = r5746346 + r5746347;
double r5746349 = d;
double r5746350 = r5746348 + r5746349;
double r5746351 = r5746345 * r5746350;
return r5746351;
}
double f(double a, double b, double c, double d) {
double r5746352 = a;
double r5746353 = b;
double r5746354 = r5746352 * r5746353;
double r5746355 = d;
double r5746356 = c;
double r5746357 = r5746355 + r5746356;
double r5746358 = r5746357 * r5746352;
double r5746359 = r5746354 + r5746358;
return r5746359;
}




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-lft-in0.0
Applied associate-+l+0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019171
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))