\frac{x \cdot \left(y + z\right)}{z}\left(\left(\frac{\sqrt[3]{x}}{\sqrt[3]{z}} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}\right) \cdot y\right) \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}} + xdouble f(double x, double y, double z) {
double r21048632 = x;
double r21048633 = y;
double r21048634 = z;
double r21048635 = r21048633 + r21048634;
double r21048636 = r21048632 * r21048635;
double r21048637 = r21048636 / r21048634;
return r21048637;
}
double f(double x, double y, double z) {
double r21048638 = x;
double r21048639 = cbrt(r21048638);
double r21048640 = z;
double r21048641 = cbrt(r21048640);
double r21048642 = r21048639 / r21048641;
double r21048643 = r21048642 * r21048642;
double r21048644 = y;
double r21048645 = r21048643 * r21048644;
double r21048646 = r21048645 * r21048642;
double r21048647 = r21048646 + r21048638;
return r21048647;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.9 |
|---|---|
| Target | 2.8 |
| Herbie | 1.4 |
Initial program 12.9
Simplified5.0
rmApplied fma-udef5.0
rmApplied add-cube-cbrt5.4
Applied add-cube-cbrt5.4
Applied times-frac5.4
Applied associate-*r*1.4
Simplified1.4
Final simplification1.4
herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))