\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \leq -5.140138329347149 \cdot 10^{+39}:\\
\;\;\;\;x \cdot \frac{z + y}{z}\\
\mathbf{elif}\;z \leq -2.590230819832462 \cdot 10^{-190}:\\
\;\;\;\;\frac{x \cdot \left(z + y\right)}{z}\\
\mathbf{elif}\;z \leq 5.046753511079363 \cdot 10^{-233}:\\
\;\;\;\;\frac{x}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{z + y}{\sqrt[3]{z}}\\
\mathbf{elif}\;z \leq 3.2609574170760183 \cdot 10^{-99}:\\
\;\;\;\;\frac{x \cdot \left(z + y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{z + y}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
(FPCore (x y z)
:precision binary64
(if (<= z -5.140138329347149e+39)
(* x (/ (+ z y) z))
(if (<= z -2.590230819832462e-190)
(/ (* x (+ z y)) z)
(if (<= z 5.046753511079363e-233)
(* (/ x (* (cbrt z) (cbrt z))) (/ (+ z y) (cbrt z)))
(if (<= z 3.2609574170760183e-99)
(/ (* x (+ z y)) z)
(/ x (/ z (+ z y))))))))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 <= -5.140138329347149e+39) {
tmp = x * ((z + y) / z);
} else if (z <= -2.590230819832462e-190) {
tmp = (x * (z + y)) / z;
} else if (z <= 5.046753511079363e-233) {
tmp = (x / (cbrt(z) * cbrt(z))) * ((z + y) / cbrt(z));
} else if (z <= 3.2609574170760183e-99) {
tmp = (x * (z + y)) / z;
} else {
tmp = x / (z / (z + y));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 2.9 |
| Herbie | 2.4 |
if z < -5.140138329347149e39Initial program 19.0
rmApplied *-un-lft-identity_binary64_1133119.0
Applied times-frac_binary64_113370.1
Simplified0.1
if -5.140138329347149e39 < z < -2.5902308198324621e-190 or 5.04675351107936281e-233 < z < 3.2609574170760183e-99Initial program 4.7
if -2.5902308198324621e-190 < z < 5.04675351107936281e-233Initial program 14.6
rmApplied add-cube-cbrt_binary64_1136615.5
Applied times-frac_binary64_113378.3
if 3.2609574170760183e-99 < z Initial program 13.6
rmApplied associate-/l*_binary64_112760.6
Final simplification2.4
herbie shell --seed 2020342
(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))