\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;y \le -1.18022250245271704 \cdot 10^{219}:\\
\;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{x}{\sqrt[3]{z}} \cdot \frac{y}{z + 1}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\frac{y}{z + 1}}{z}\right)\\
\end{array}double code(double x, double y, double z) {
return ((x * y) / ((z * z) * (z + 1.0)));
}
double code(double x, double y, double z) {
double temp;
if ((y <= -1.180222502452717e+219)) {
temp = (((cbrt(1.0) * cbrt(1.0)) / 1.0) * (((1.0 / (cbrt(z) * cbrt(z))) * ((x / cbrt(z)) * (y / (z + 1.0)))) / z));
} else {
temp = ((1.0 / z) * (x * ((y / (z + 1.0)) / z)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 14.9 |
|---|---|
| Target | 4.2 |
| Herbie | 3.0 |
if y < -1.180222502452717e+219Initial program 24.1
rmApplied times-frac13.0
rmApplied *-un-lft-identity13.0
Applied times-frac6.7
Applied associate-*l*3.9
rmApplied *-un-lft-identity3.9
Applied add-cube-cbrt3.9
Applied times-frac3.9
Applied associate-*l*3.9
Simplified3.9
rmApplied add-cube-cbrt4.4
Applied *-un-lft-identity4.4
Applied times-frac4.4
Applied associate-*l*5.2
if -1.180222502452717e+219 < y Initial program 14.4
rmApplied times-frac11.0
rmApplied *-un-lft-identity11.0
Applied times-frac5.7
Applied associate-*l*2.6
rmApplied div-inv2.7
Applied associate-*l*2.9
Simplified2.8
Final simplification3.0
herbie shell --seed 2020060
(FPCore (x y z)
:name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1))))