\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \left(\left(\left(a + d\right) + c\right) + b\right)
double f(double a, double b, double c, double d) {
double r3246091 = a;
double r3246092 = b;
double r3246093 = c;
double r3246094 = d;
double r3246095 = r3246093 + r3246094;
double r3246096 = r3246092 + r3246095;
double r3246097 = r3246091 + r3246096;
double r3246098 = 2.0;
double r3246099 = r3246097 * r3246098;
return r3246099;
}
double f(double a, double b, double c, double d) {
double r3246100 = 2.0;
double r3246101 = a;
double r3246102 = d;
double r3246103 = r3246101 + r3246102;
double r3246104 = c;
double r3246105 = r3246103 + r3246104;
double r3246106 = b;
double r3246107 = r3246105 + r3246106;
double r3246108 = r3246100 * r3246107;
return r3246108;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.6 |
|---|---|
| Target | 3.8 |
| Herbie | 0 |
Initial program 3.6
rmApplied associate-+r+2.8
rmApplied add-log-exp3.0
rmApplied pow13.0
Applied log-pow3.0
Simplified0
Final simplification0
herbie shell --seed 2019133
(FPCore (a b c d)
:name "Expression, p6"
:pre (and (<= -14 a -13) (<= -3 b -2) (<= 3 c 3.5) (<= 12.5 d 13.5))
:herbie-target
(+ (* (+ a b) 2) (* (+ c d) 2))
(* (+ a (+ b (+ c d))) 2))