\frac{x \cdot \left(y + z\right)}{z}\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{z}}{y}} + xdouble f(double x, double y, double z) {
double r303116 = x;
double r303117 = y;
double r303118 = z;
double r303119 = r303117 + r303118;
double r303120 = r303116 * r303119;
double r303121 = r303120 / r303118;
return r303121;
}
double f(double x, double y, double z) {
double r303122 = x;
double r303123 = cbrt(r303122);
double r303124 = r303123 * r303123;
double r303125 = z;
double r303126 = cbrt(r303125);
double r303127 = r303126 * r303126;
double r303128 = r303124 / r303127;
double r303129 = y;
double r303130 = r303126 / r303129;
double r303131 = r303123 / r303130;
double r303132 = r303128 * r303131;
double r303133 = r303132 + r303122;
return r303133;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 3.2 |
| Herbie | 1.8 |
Initial program 12.3
Simplified3.4
Taylor expanded around 0 4.6
Simplified5.2
rmApplied fma-udef5.2
Simplified4.6
rmApplied associate-/l*3.1
rmApplied *-un-lft-identity3.1
Applied add-cube-cbrt3.5
Applied times-frac3.6
Applied add-cube-cbrt3.6
Applied times-frac1.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2019323 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))