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 r97476 = a;
double r97477 = b;
double r97478 = c;
double r97479 = r97477 + r97478;
double r97480 = d;
double r97481 = r97479 + r97480;
double r97482 = r97476 * r97481;
return r97482;
}
double f(double a, double b, double c, double d) {
double r97483 = b;
double r97484 = a;
double r97485 = r97483 * r97484;
double r97486 = c;
double r97487 = d;
double r97488 = r97486 + r97487;
double r97489 = r97484 * r97488;
double r97490 = r97485 + r97489;
return r97490;
}




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 2019362
(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)))