a \cdot \left(\left(b + c\right) + d\right)
c \cdot a + \left(d + b\right) \cdot a
double f(double a, double b, double c, double d) {
double r59880 = a;
double r59881 = b;
double r59882 = c;
double r59883 = r59881 + r59882;
double r59884 = d;
double r59885 = r59883 + r59884;
double r59886 = r59880 * r59885;
return r59886;
}
double f(double a, double b, double c, double d) {
double r59887 = c;
double r59888 = a;
double r59889 = r59887 * r59888;
double r59890 = d;
double r59891 = b;
double r59892 = r59890 + r59891;
double r59893 = r59892 * r59888;
double r59894 = r59889 + r59893;
return r59894;
}




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
Simplified0.0
rmApplied add-sqr-sqrt0.5
Simplified0.5
Simplified0.5
Taylor expanded around inf 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019174
(FPCore (a b c d)
:name "Expression, p14"
:pre (and (<= 56789.0 a 98765.0) (<= 0.0 b 1.0) (<= 0.0 c 0.0016773) (<= 0.0 d 0.0016773))
:herbie-target
(+ (* a b) (* a (+ c d)))
(* a (+ (+ b c) d)))