\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -6.0290209966276913 \cdot 10^{162}:\\
\;\;\;\;\frac{\frac{y}{z + 1}}{\frac{z}{x} \cdot z}\\
\mathbf{elif}\;x \cdot y \le -1.619015216158531 \cdot 10^{-110}:\\
\;\;\;\;\frac{\frac{x \cdot y}{z}}{z \cdot \left(z + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{y}{z}}{\frac{z}{x}}}{z + 1}\\
\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 VAR;
if (((x * y) <= -6.029020996627691e+162)) {
VAR = ((y / (z + 1.0)) / ((z / x) * z));
} else {
double VAR_1;
if (((x * y) <= -1.6190152161585307e-110)) {
VAR_1 = (((x * y) / z) / (z * (z + 1.0)));
} else {
VAR_1 = (((y / z) / (z / x)) / (z + 1.0));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 14.8 |
|---|---|
| Target | 3.9 |
| Herbie | 1.8 |
if (* x y) < -6.029020996627691e+162Initial program 34.4
rmApplied associate-*l*34.4
Applied times-frac10.0
rmApplied *-commutative10.0
Applied associate-/r*1.8
Applied clear-num1.9
Applied frac-times1.5
Simplified1.5
if -6.029020996627691e+162 < (* x y) < -1.6190152161585307e-110Initial program 3.4
rmApplied associate-*l*3.4
Applied associate-/r*0.2
if -1.6190152161585307e-110 < (* x y) Initial program 15.2
rmApplied associate-*l*15.2
Applied times-frac3.9
rmApplied associate-/r*2.8
Applied associate-*r/2.3
rmApplied clear-num2.4
Applied associate-*l/2.2
Simplified2.2
Final simplification1.8
herbie shell --seed 2020078
(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))))