\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2
2 \cdot \sqrt[3]{\log \left(e^{\left(a + c\right) + \left(b + d\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 r12322369 = a;
double r12322370 = b;
double r12322371 = c;
double r12322372 = d;
double r12322373 = r12322371 + r12322372;
double r12322374 = r12322370 + r12322373;
double r12322375 = r12322369 + r12322374;
double r12322376 = 2.0;
double r12322377 = r12322375 * r12322376;
return r12322377;
}
double f(double a, double b, double c, double d) {
double r12322378 = 2.0;
double r12322379 = a;
double r12322380 = c;
double r12322381 = r12322379 + r12322380;
double r12322382 = b;
double r12322383 = d;
double r12322384 = r12322382 + r12322383;
double r12322385 = r12322381 + r12322384;
double r12322386 = exp(r12322385);
double r12322387 = log(r12322386);
double r12322388 = r12322382 + r12322380;
double r12322389 = r12322388 + r12322383;
double r12322390 = r12322389 + r12322379;
double r12322391 = r12322390 * r12322390;
double r12322392 = r12322387 * r12322391;
double r12322393 = cbrt(r12322392);
double r12322394 = r12322378 * r12322393;
return r12322394;
}




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 sum-log2.8
Simplified2.8
Final simplification2.8
herbie shell --seed 2019104
(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))