\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \sqrt[3]{\left(\log \left(e^{b}\right) + \left(\left(a + d\right) + 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 r27931698 = a;
double r27931699 = b;
double r27931700 = c;
double r27931701 = d;
double r27931702 = r27931700 + r27931701;
double r27931703 = r27931699 + r27931702;
double r27931704 = r27931698 + r27931703;
double r27931705 = 2.0;
double r27931706 = r27931704 * r27931705;
return r27931706;
}
double f(double a, double b, double c, double d) {
double r27931707 = 2.0;
double r27931708 = b;
double r27931709 = exp(r27931708);
double r27931710 = log(r27931709);
double r27931711 = a;
double r27931712 = d;
double r27931713 = r27931711 + r27931712;
double r27931714 = c;
double r27931715 = r27931713 + r27931714;
double r27931716 = r27931710 + r27931715;
double r27931717 = r27931708 + r27931714;
double r27931718 = r27931717 + r27931712;
double r27931719 = r27931718 + r27931711;
double r27931720 = r27931719 * r27931719;
double r27931721 = r27931716 * r27931720;
double r27931722 = cbrt(r27931721);
double r27931723 = r27931707 * r27931722;
return r27931723;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.7 |
|---|---|
| Target | 3.8 |
| Herbie | 2.5 |
Initial program 3.7
rmApplied associate-+r+2.8
rmApplied add-cbrt-cube2.9
rmApplied add-log-exp2.9
Applied add-log-exp2.9
Applied sum-log2.7
Applied add-log-exp2.7
Applied sum-log2.6
Simplified2.9
rmApplied exp-sum2.9
Applied log-prod2.9
Simplified2.5
Final simplification2.5
herbie shell --seed 2019107
(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))