a \cdot \left(\left(b + c\right) + d\right)
a \cdot b + \left(c + d\right) \cdot a
double f(double a, double b, double c, double d) {
double r1956873 = a;
double r1956874 = b;
double r1956875 = c;
double r1956876 = r1956874 + r1956875;
double r1956877 = d;
double r1956878 = r1956876 + r1956877;
double r1956879 = r1956873 * r1956878;
return r1956879;
}
double f(double a, double b, double c, double d) {
double r1956880 = a;
double r1956881 = b;
double r1956882 = r1956880 * r1956881;
double r1956883 = c;
double r1956884 = d;
double r1956885 = r1956883 + r1956884;
double r1956886 = r1956885 * r1956880;
double r1956887 = r1956882 + r1956886;
return r1956887;
}




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