\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}\begin{array}{l}
\mathbf{if}\;x \cdot y \le 7.8962089579623809 \cdot 10^{-127} \lor \neg \left(x \cdot y \le 1.06517562882529206 \cdot 10^{204}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{\frac{y}{z + 1}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot y}{z \cdot \left(z + 1\right)}}{z}\\
\end{array}double f(double x, double y, double z) {
double r243393 = x;
double r243394 = y;
double r243395 = r243393 * r243394;
double r243396 = z;
double r243397 = r243396 * r243396;
double r243398 = 1.0;
double r243399 = r243396 + r243398;
double r243400 = r243397 * r243399;
double r243401 = r243395 / r243400;
return r243401;
}
double f(double x, double y, double z) {
double r243402 = x;
double r243403 = y;
double r243404 = r243402 * r243403;
double r243405 = 7.896208957962381e-127;
bool r243406 = r243404 <= r243405;
double r243407 = 1.065175628825292e+204;
bool r243408 = r243404 <= r243407;
double r243409 = !r243408;
bool r243410 = r243406 || r243409;
double r243411 = z;
double r243412 = r243402 / r243411;
double r243413 = 1.0;
double r243414 = r243411 + r243413;
double r243415 = r243403 / r243414;
double r243416 = r243415 / r243411;
double r243417 = r243412 * r243416;
double r243418 = r243411 * r243414;
double r243419 = r243404 / r243418;
double r243420 = r243419 / r243411;
double r243421 = r243410 ? r243417 : r243420;
return r243421;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.5 |
|---|---|
| Target | 4.0 |
| Herbie | 1.9 |
if (* x y) < 7.896208957962381e-127 or 1.065175628825292e+204 < (* x y) Initial program 18.6
rmApplied times-frac12.6
rmApplied *-un-lft-identity12.6
Applied times-frac6.0
Applied associate-*l*2.5
rmApplied associate-*l/7.4
Applied associate-*r/7.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied times-frac2.3
Simplified2.3
if 7.896208957962381e-127 < (* x y) < 1.065175628825292e+204Initial program 4.2
rmApplied times-frac7.7
rmApplied *-un-lft-identity7.7
Applied times-frac6.8
Applied associate-*l*2.9
rmApplied associate-*l/0.8
Applied associate-*r/0.8
Simplified2.9
rmApplied frac-times0.5
Final simplification1.9
herbie shell --seed 2020020 +o rules:numerics
(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))))