\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 r42663408 = a;
double r42663409 = b;
double r42663410 = c;
double r42663411 = d;
double r42663412 = r42663410 + r42663411;
double r42663413 = r42663409 + r42663412;
double r42663414 = r42663408 + r42663413;
double r42663415 = 2.0;
double r42663416 = r42663414 * r42663415;
return r42663416;
}
double f(double a, double b, double c, double d) {
double r42663417 = 2.0;
double r42663418 = a;
double r42663419 = c;
double r42663420 = r42663418 + r42663419;
double r42663421 = b;
double r42663422 = d;
double r42663423 = r42663421 + r42663422;
double r42663424 = r42663420 + r42663423;
double r42663425 = exp(r42663424);
double r42663426 = log(r42663425);
double r42663427 = r42663421 + r42663419;
double r42663428 = r42663427 + r42663422;
double r42663429 = r42663428 + r42663418;
double r42663430 = r42663429 * r42663429;
double r42663431 = r42663426 * r42663430;
double r42663432 = cbrt(r42663431);
double r42663433 = r42663417 * r42663432;
return r42663433;
}




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 3.6 |
|---|---|
| Target | 3.8 |
| Herbie | 2.7 |
Initial program 3.6
rmApplied associate-+r+2.7
rmApplied add-cbrt-cube2.9
rmApplied associate-+r+2.7
rmApplied add-log-exp2.7
Applied add-log-exp2.7
Applied sum-log2.8
Simplified2.7
Final simplification2.7
herbie shell --seed 2019128
(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))