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




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 15.4 |
|---|---|
| Target | 4.0 |
| Herbie | 2.9 |
if z < -5.3323637954609783e-308Initial program 15.2
Simplified8.0
Applied *-un-lft-identity_binary648.0
Applied add-cube-cbrt_binary648.4
Applied add-cube-cbrt_binary648.5
Applied times-frac_binary648.5
Applied times-frac_binary648.5
Applied associate-*r*_binary643.8
Simplified3.8
if -5.3323637954609783e-308 < z Initial program 15.6
Simplified8.9
Applied associate-*r/_binary644.8
Applied associate-/l*_binary648.7
Applied add-sqr-sqrt_binary648.8
Applied add-cube-cbrt_binary649.1
Applied times-frac_binary649.1
Applied *-un-lft-identity_binary649.1
Applied times-frac_binary649.3
Applied *-un-lft-identity_binary649.3
Applied times-frac_binary645.6
Simplified5.6
Simplified2.0
Final simplification2.9
herbie shell --seed 2022081
(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))))