\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.7270956690352767 \cdot 10^{-186}:\\
\;\;\;\;\frac{\frac{x \cdot \frac{y}{z + 1}}{z}}{z}\\
\mathbf{elif}\;x \cdot y \le 1.1176947562290144 \cdot 10^{258}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot y}{z \cdot \left(z + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{z} \cdot \frac{y}{z + 1}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * y)) / ((double) (((double) (z * z)) * ((double) (z + 1.0))))));
}
double code(double x, double y, double z) {
double VAR;
if ((((double) (x * y)) <= -1.7270956690352767e-186)) {
VAR = ((double) (((double) (((double) (x * ((double) (y / ((double) (z + 1.0)))))) / z)) / z));
} else {
double VAR_1;
if ((((double) (x * y)) <= 1.1176947562290144e+258)) {
VAR_1 = ((double) (((double) (((double) (x / z)) * y)) / ((double) (z * ((double) (z + 1.0))))));
} else {
VAR_1 = ((double) (((double) (((double) (x / z)) / z)) * ((double) (y / ((double) (z + 1.0))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.2 |
|---|---|
| Target | 4.1 |
| Herbie | 2.3 |
if (* x y) < -1.7270956690352767e-186Initial program 12.4
rmApplied times-frac10.3
rmApplied add-cube-cbrt10.7
Applied times-frac7.2
Applied associate-*l*1.5
rmApplied associate-*l/1.5
Applied associate-*r/1.9
Simplified2.1
if -1.7270956690352767e-186 < (* x y) < 1.1176947562290144e258Initial program 13.3
rmApplied times-frac11.4
rmApplied *-un-lft-identity11.4
Applied times-frac6.2
Applied associate-*l*2.5
rmApplied associate-*r/2.3
Applied frac-times2.5
Simplified2.5
if 1.1176947562290144e258 < (* x y) Initial program 51.1
rmApplied times-frac15.2
rmApplied associate-/r*1.3
Final simplification2.3
herbie shell --seed 2020152
(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))))