\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 r2111033 = a;
double r2111034 = b;
double r2111035 = c;
double r2111036 = d;
double r2111037 = r2111035 + r2111036;
double r2111038 = r2111034 + r2111037;
double r2111039 = r2111033 + r2111038;
double r2111040 = 2.0;
double r2111041 = r2111039 * r2111040;
return r2111041;
}
double f(double a, double b, double c, double d) {
double r2111042 = 2.0;
double r2111043 = a;
double r2111044 = d;
double r2111045 = r2111043 + r2111044;
double r2111046 = c;
double r2111047 = r2111045 + r2111046;
double r2111048 = b;
double r2111049 = r2111047 + r2111048;
double r2111050 = r2111042 * r2111049;
return r2111050;
}




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
rmApplied add-log-exp3.7
Applied add-log-exp3.7
Applied sum-log3.7
Applied add-log-exp3.7
Applied sum-log3.7
Simplified0.9
rmApplied rem-log-exp0.0
rmApplied associate-+l+0
Final simplification0
herbie shell --seed 2019144
(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))