\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;y \le -1.438885507548026 \cdot 10^{-79} \lor \neg \left(y \le 1.57328907124898461 \cdot 10^{-187}\right):\\
\;\;\;\;\left(\sqrt[3]{y} \cdot \left(\frac{\sqrt[3]{y}}{z} \cdot \frac{x}{z}\right)\right) \cdot \frac{\sqrt[3]{y}}{z + 1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{y}{z}}{z \cdot \left(z + 1\right)}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * y)) / ((double) (((double) (z * z)) * ((double) (z + 1.0)))));
}
double code(double x, double y, double z) {
double VAR;
if (((y <= -1.438885507548026e-79) || !(y <= 1.5732890712489846e-187))) {
VAR = ((double) (((double) (((double) cbrt(y)) * ((double) ((((double) cbrt(y)) / z) * (x / z))))) * (((double) cbrt(y)) / ((double) (z + 1.0)))));
} else {
VAR = ((double) (x * ((y / z) / ((double) (z * ((double) (z + 1.0)))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 14.8 |
|---|---|
| Target | 4.3 |
| Herbie | 3.2 |
if y < -1.438885507548026e-79 or 1.57328907124898461e-187 < y Initial program 14.9
Simplified13.9
rmApplied add-cube-cbrt14.2
Applied times-frac10.8
Applied associate-*r*4.6
Simplified4.6
rmApplied *-un-lft-identity4.6
Applied times-frac3.1
Applied associate-*r*1.9
Simplified2.1
if -1.438885507548026e-79 < y < 1.57328907124898461e-187Initial program 14.7
Simplified13.5
rmApplied associate-/r*5.2
Final simplification3.2
herbie shell --seed 2020182
(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.0 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1.0))))