\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \leq -8.062707745030684 \cdot 10^{-149} \lor \neg \left(z \leq 1.9037644023640054 \cdot 10^{-135}\right):\\
\;\;\;\;\frac{x}{\frac{z}{z + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{z + y}{\sqrt[3]{z}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
(FPCore (x y z) :precision binary64 (if (or (<= z -8.062707745030684e-149) (not (<= z 1.9037644023640054e-135))) (/ x (/ z (+ z y))) (* (/ x (* (cbrt z) (cbrt z))) (/ (+ z y) (cbrt z)))))
double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((z <= -8.062707745030684e-149) || !(z <= 1.9037644023640054e-135)) {
tmp = x / (z / (z + y));
} else {
tmp = (x / (cbrt(z) * cbrt(z))) * ((z + y) / cbrt(z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 2.9 |
| Herbie | 2.7 |
if z < -8.0627077450306839e-149 or 1.90376440236400544e-135 < z Initial program 12.8
rmApplied associate-/l*_binary641.1
if -8.0627077450306839e-149 < z < 1.90376440236400544e-135Initial program 11.6
rmApplied add-cube-cbrt_binary6412.6
Applied times-frac_binary649.2
Final simplification2.7
herbie shell --seed 2020220
(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))