a \cdot \left(\left(b + c\right) + d\right)
\left(b \cdot a + a \cdot c\right) + a \cdot d
double f(double a, double b, double c, double d) {
double r58446 = a;
double r58447 = b;
double r58448 = c;
double r58449 = r58447 + r58448;
double r58450 = d;
double r58451 = r58449 + r58450;
double r58452 = r58446 * r58451;
return r58452;
}
double f(double a, double b, double c, double d) {
double r58453 = b;
double r58454 = a;
double r58455 = r58453 * r58454;
double r58456 = c;
double r58457 = r58454 * r58456;
double r58458 = r58455 + r58457;
double r58459 = d;
double r58460 = r58454 * r58459;
double r58461 = r58458 + r58460;
return r58461;
}




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