a \cdot \left(\left(b + c\right) + d\right)
b \cdot a + a \cdot \left(c + d\right)
double f(double a, double b, double c, double d) {
double r71215 = a;
double r71216 = b;
double r71217 = c;
double r71218 = r71216 + r71217;
double r71219 = d;
double r71220 = r71218 + r71219;
double r71221 = r71215 * r71220;
return r71221;
}
double f(double a, double b, double c, double d) {
double r71222 = b;
double r71223 = a;
double r71224 = r71222 * r71223;
double r71225 = c;
double r71226 = d;
double r71227 = r71225 + r71226;
double r71228 = r71223 * r71227;
double r71229 = r71224 + r71228;
return r71229;
}




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 2020021
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (<= 56789 a 98765) (<= 0.0 b 1) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))