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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.2 |
|---|---|
| Target | 2.9 |
| Herbie | 3.0 |
if y < 4.7493213015860137e140Initial program 12.1
rmApplied associate-/l*_binary642.1
if 4.7493213015860137e140 < y Initial program 13.4
rmApplied add-cube-cbrt_binary6414.4
Applied associate-/r*_binary6414.4
Simplified11.1
Final simplification3.0
herbie shell --seed 2020253
(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))