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 r242065 = a;
double r242066 = b;
double r242067 = c;
double r242068 = r242066 + r242067;
double r242069 = d;
double r242070 = r242068 + r242069;
double r242071 = r242065 * r242070;
return r242071;
}
double f(double a, double b, double c, double d) {
double r242072 = b;
double r242073 = c;
double r242074 = r242072 + r242073;
double r242075 = a;
double r242076 = r242074 * r242075;
double r242077 = d;
double r242078 = r242077 * r242075;
double r242079 = r242076 + r242078;
return r242079;
}




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