\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \sqrt[3]{\log \left(e^{\left(b + d\right) + \left(a + c\right)}\right) \cdot \left(\left(\left(\left(b + c\right) + d\right) + a\right) \cdot \left(\left(\left(b + c\right) + d\right) + a\right)\right)}double f(double a, double b, double c, double d) {
double r11153118 = a;
double r11153119 = b;
double r11153120 = c;
double r11153121 = d;
double r11153122 = r11153120 + r11153121;
double r11153123 = r11153119 + r11153122;
double r11153124 = r11153118 + r11153123;
double r11153125 = 2.0;
double r11153126 = r11153124 * r11153125;
return r11153126;
}
double f(double a, double b, double c, double d) {
double r11153127 = 2.0;
double r11153128 = b;
double r11153129 = d;
double r11153130 = r11153128 + r11153129;
double r11153131 = a;
double r11153132 = c;
double r11153133 = r11153131 + r11153132;
double r11153134 = r11153130 + r11153133;
double r11153135 = exp(r11153134);
double r11153136 = log(r11153135);
double r11153137 = r11153128 + r11153132;
double r11153138 = r11153137 + r11153129;
double r11153139 = r11153138 + r11153131;
double r11153140 = r11153139 * r11153139;
double r11153141 = r11153136 * r11153140;
double r11153142 = cbrt(r11153141);
double r11153143 = r11153127 * r11153142;
return r11153143;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.9 |
| Herbie | 2.8 |
Initial program 3.7
rmApplied associate-+r+2.8
rmApplied add-cbrt-cube2.9
rmApplied associate-+r+2.8
rmApplied add-log-exp2.8
Applied add-log-exp2.8
Applied add-log-exp2.8
Applied sum-log2.8
Applied add-log-exp2.8
Applied sum-log2.8
Applied sum-log2.7
Simplified2.8
Final simplification2.8
herbie shell --seed 2019104 +o rules:numerics
(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))