\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \leq -9.162031571097381 \cdot 10^{+136}:\\
\;\;\;\;x + \left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{z}\\
\mathbf{elif}\;y \leq 1.8848281515184507 \cdot 10^{+219}:\\
\;\;\;\;x + x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(x \cdot \sqrt[3]{y}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z}}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * ((double) (y + z)))) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -9.162031571097381e+136)) {
VAR = ((double) (x + ((double) (((double) (x * ((double) (((double) cbrt(y)) * ((double) cbrt(y)))))) * (((double) cbrt(y)) / z)))));
} else {
double VAR_1;
if ((y <= 1.8848281515184507e+219)) {
VAR_1 = ((double) (x + ((double) (x * (y / z)))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (((double) (x * ((double) cbrt(y)))) * (((double) cbrt(y)) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))))) * (((double) cbrt(y)) / ((double) cbrt(z)))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 2.8 |
| Herbie | 2.4 |
if y < -9.16203157109738136e136Initial program Error: 12.7 bits
SimplifiedError: 10.9 bits
rmApplied *-un-lft-identityError: 10.9 bits
Applied add-cube-cbrtError: 11.5 bits
Applied times-fracError: 11.5 bits
Applied associate-*r*Error: 8.3 bits
SimplifiedError: 8.3 bits
if -9.16203157109738136e136 < y < 1.8848281515184507e219Initial program Error: 12.1 bits
SimplifiedError: 1.6 bits
if 1.8848281515184507e219 < y Initial program Error: 16.8 bits
SimplifiedError: 12.9 bits
rmApplied add-cube-cbrtError: 13.6 bits
Applied add-cube-cbrtError: 13.8 bits
Applied times-fracError: 13.8 bits
Applied associate-*r*Error: 4.7 bits
SimplifiedError: 4.7 bits
rmApplied associate-*r*Error: 4.1 bits
Final simplificationError: 2.4 bits
herbie shell --seed 2020200
(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))