\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;x \le 6.83050355077890696 \cdot 10^{-289}:\\
\;\;\;\;\frac{\sqrt{1}}{1} \cdot \frac{\frac{x}{z}}{\frac{z}{\frac{y}{z + 1}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x}}{z} \cdot \left(\frac{\sqrt{x}}{z} \cdot \frac{y}{z + 1}\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 ((x <= 6.830503550778907e-289)) {
temp = ((sqrt(1.0) / 1.0) * ((x / z) / (z / (y / (z + 1.0)))));
} else {
temp = ((sqrt(x) / z) * ((sqrt(x) / z) * (y / (z + 1.0))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.1 |
|---|---|
| Target | 4.0 |
| Herbie | 1.8 |
if x < 6.830503550778907e-289Initial program 15.5
rmApplied times-frac11.3
rmApplied *-un-lft-identity11.3
Applied times-frac6.1
Applied associate-*l*2.6
rmApplied *-un-lft-identity2.6
Applied add-sqr-sqrt2.6
Applied times-frac2.6
Applied associate-*l*2.6
Simplified2.6
rmApplied associate-/l*3.1
if 6.830503550778907e-289 < x Initial program 14.8
rmApplied times-frac10.8
rmApplied add-sqr-sqrt10.9
Applied times-frac6.1
Applied associate-*l*0.5
Final simplification1.8
herbie shell --seed 2020053
(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))))