a \cdot \left(\left(b + c\right) + d\right)
a \cdot \left(b + \left(c + d\right)\right)
double f(double a, double b, double c, double d) {
double r71698 = a;
double r71699 = b;
double r71700 = c;
double r71701 = r71699 + r71700;
double r71702 = d;
double r71703 = r71701 + r71702;
double r71704 = r71698 * r71703;
return r71704;
}
double f(double a, double b, double c, double d) {
double r71705 = a;
double r71706 = b;
double r71707 = c;
double r71708 = d;
double r71709 = r71707 + r71708;
double r71710 = r71706 + r71709;
double r71711 = r71705 * r71710;
return r71711;
}




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
rmApplied distribute-lft-out0.0
Final simplification0.0
herbie shell --seed 2019308
(FPCore (a b c d)
:name "Expression, p14"
:precision binary64
:pre (and (<= 56789 a 98765) (<= 0.0 b 1) (<= 0.0 c 0.0016773000000000001) (<= 0.0 d 0.0016773000000000001))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))