\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
\left(\left(c + b\right) + \left(d + a\right)\right) \cdot 2
double f(double a, double b, double c, double d) {
double r78317 = a;
double r78318 = b;
double r78319 = c;
double r78320 = d;
double r78321 = r78319 + r78320;
double r78322 = r78318 + r78321;
double r78323 = r78317 + r78322;
double r78324 = 2.0;
double r78325 = r78323 * r78324;
return r78325;
}
double f(double a, double b, double c, double d) {
double r78326 = c;
double r78327 = b;
double r78328 = r78326 + r78327;
double r78329 = d;
double r78330 = a;
double r78331 = r78329 + r78330;
double r78332 = r78328 + r78331;
double r78333 = 2.0;
double r78334 = r78332 * r78333;
return r78334;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.8 |
| Herbie | 0 |
Initial program 3.7
Simplified3.1
rmApplied flip-+3.5
Simplified2.8
Simplified2.8
rmApplied *-un-lft-identity2.8
Applied times-frac2.7
Simplified0
Simplified0
Final simplification0
herbie shell --seed 2019195
(FPCore (a b c d)
:name "Expression, p6"
:pre (and (<= -14.0 a -13.0) (<= -3.0 b -2.0) (<= 3.0 c 3.5) (<= 12.5 d 13.5))
:herbie-target
(+ (* (+ a b) 2.0) (* (+ c d) 2.0))
(* (+ a (+ b (+ c d))) 2.0))