\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
\mathbf{if}\;\left(z \cdot z\right) \cdot \left(z + 1\right) \leq 4.926228586799335 \cdot 10^{+297}:\\
\;\;\;\;\begin{array}{l}
t_0 := \sqrt[3]{\mathsf{fma}\left(z, z, z\right)}\\
\left(x \cdot \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{t_0 \cdot t_0}\right) \cdot \frac{\frac{\sqrt[3]{y}}{t_0}}{z}
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \mathsf{hypot}\left(z, \sqrt{z}\right)\\
\frac{\frac{y}{t_1} \cdot \frac{x}{t_1}}{z}
\end{array}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
(FPCore (x y z)
:precision binary64
(if (<= (* (* z z) (+ z 1.0)) 4.926228586799335e+297)
(let* ((t_0 (cbrt (fma z z z))))
(* (* x (/ (* (cbrt y) (cbrt y)) (* t_0 t_0))) (/ (/ (cbrt y) t_0) z)))
(let* ((t_1 (hypot z (sqrt z)))) (/ (* (/ y t_1) (/ x t_1)) z))))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 tmp;
if (((z * z) * (z + 1.0)) <= 4.926228586799335e+297) {
double t_0_1 = cbrt(fma(z, z, z));
tmp = (x * ((cbrt(y) * cbrt(y)) / (t_0_1 * t_0_1))) * ((cbrt(y) / t_0_1) / z);
} else {
double t_1 = hypot(z, sqrt(z));
tmp = ((y / t_1) * (x / t_1)) / z;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 14.6 |
|---|---|
| Target | 4.2 |
| Herbie | 3.1 |
if (*.f64 (*.f64 z z) (+.f64 z 1)) < 4.92622858679933495e297Initial program 15.0
Simplified8.9
Applied *-un-lft-identity_binary648.9
Applied add-cube-cbrt_binary649.4
Applied add-cube-cbrt_binary649.5
Applied times-frac_binary649.5
Applied times-frac_binary649.5
Applied associate-*r*_binary643.9
Simplified3.9
if 4.92622858679933495e297 < (*.f64 (*.f64 z z) (+.f64 z 1)) Initial program 13.3
Simplified5.8
Applied associate-*r/_binary645.0
Taylor expanded in x around 0 9.8
Simplified9.8
Applied add-sqr-sqrt_binary649.8
Applied times-frac_binary644.5
Simplified4.5
Simplified0.3
Final simplification3.1
herbie shell --seed 2022077
(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))))