a \cdot \left(\left(b + c\right) + d\right)
\left(b + c\right) \cdot a + d \cdot a
double f(double a, double b, double c, double d) {
double r102808 = a;
double r102809 = b;
double r102810 = c;
double r102811 = r102809 + r102810;
double r102812 = d;
double r102813 = r102811 + r102812;
double r102814 = r102808 * r102813;
return r102814;
}
double f(double a, double b, double c, double d) {
double r102815 = b;
double r102816 = c;
double r102817 = r102815 + r102816;
double r102818 = a;
double r102819 = r102817 * r102818;
double r102820 = d;
double r102821 = r102820 * r102818;
double r102822 = r102819 + r102821;
return r102822;
}




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
Simplified0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019325
(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)))