\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 r14734816 = a;
double r14734817 = b;
double r14734818 = c;
double r14734819 = d;
double r14734820 = r14734818 + r14734819;
double r14734821 = r14734817 + r14734820;
double r14734822 = r14734816 + r14734821;
double r14734823 = 2.0;
double r14734824 = r14734822 * r14734823;
return r14734824;
}
double f(double a, double b, double c, double d) {
double r14734825 = 2.0;
double r14734826 = b;
double r14734827 = exp(r14734826);
double r14734828 = log(r14734827);
double r14734829 = a;
double r14734830 = d;
double r14734831 = r14734829 + r14734830;
double r14734832 = c;
double r14734833 = r14734831 + r14734832;
double r14734834 = r14734828 + r14734833;
double r14734835 = r14734826 + r14734832;
double r14734836 = r14734835 + r14734830;
double r14734837 = r14734836 + r14734829;
double r14734838 = r14734837 * r14734837;
double r14734839 = r14734834 * r14734838;
double r14734840 = cbrt(r14734839);
double r14734841 = r14734825 * r14734840;
return r14734841;
}




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))