\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
t_0 := \frac{1}{\frac{z}{x} \cdot \left(\frac{z}{y} + \frac{z}{\frac{y}{z}}\right)}\\
\mathbf{if}\;x \cdot y \leq -1.6594710605531548 \cdot 10^{+205}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{\frac{x \cdot y}{\mathsf{fma}\left(z, z, z\right)}}{z}\\
\mathbf{if}\;x \cdot y \leq -2.275563410703594 \cdot 10^{-152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 7.7566315 \cdot 10^{-316}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{y}{\mathsf{fma}\left(z, z, z\right)}}}\\
\mathbf{elif}\;x \cdot y \leq 1.5254635472042655 \cdot 10^{+188}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\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 (/ 1.0 (* (/ z x) (+ (/ z y) (/ z (/ y z)))))))
(if (<= (* x y) -1.6594710605531548e+205)
t_0
(let* ((t_1 (/ (/ (* x y) (fma z z z)) z)))
(if (<= (* x y) -2.275563410703594e-152)
t_1
(if (<= (* x y) 7.7566315e-316)
(/ 1.0 (/ (/ z x) (/ y (fma z z z))))
(if (<= (* x y) 1.5254635472042655e+188) t_1 t_0)))))))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 = 1.0 / ((z / x) * ((z / y) + (z / (y / z))));
double tmp;
if ((x * y) <= -1.6594710605531548e+205) {
tmp = t_0;
} else {
double t_1 = ((x * y) / fma(z, z, z)) / z;
double tmp_1;
if ((x * y) <= -2.275563410703594e-152) {
tmp_1 = t_1;
} else if ((x * y) <= 7.7566315e-316) {
tmp_1 = 1.0 / ((z / x) / (y / fma(z, z, z)));
} else if ((x * y) <= 1.5254635472042655e+188) {
tmp_1 = t_1;
} else {
tmp_1 = t_0;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 15.1 |
|---|---|
| Target | 4.0 |
| Herbie | 0.7 |
if (*.f64 x y) < -1.65947106055315481e205 or 1.5254635472042655e188 < (*.f64 x y) Initial program 38.1
Simplified13.9
rmApplied *-commutative_binary6413.9
Applied associate-*l/_binary6414.0
Simplified14.0
rmApplied add-cube-cbrt_binary6414.4
Applied associate-*l*_binary6414.4
Simplified14.4
rmApplied clear-num_binary6414.4
Simplified14.0
Taylor expanded around 0 43.7
Simplified2.0
if -1.65947106055315481e205 < (*.f64 x y) < -2.2755634107035938e-152 or 7.756631482e-316 < (*.f64 x y) < 1.5254635472042655e188Initial program 6.2
Simplified7.5
rmApplied *-commutative_binary647.5
Applied associate-*l/_binary642.9
Simplified2.9
rmApplied pow1_binary642.9
Applied pow1_binary642.9
Applied pow-prod-down_binary642.9
Simplified0.4
if -2.2755634107035938e-152 < (*.f64 x y) < 7.756631482e-316Initial program 21.0
Simplified6.4
rmApplied *-commutative_binary646.4
Applied associate-*l/_binary642.7
Simplified2.7
rmApplied add-cube-cbrt_binary643.1
Applied associate-*l*_binary643.2
Simplified3.2
rmApplied clear-num_binary643.3
Simplified2.9
rmApplied add-cube-cbrt_binary643.3
Applied times-frac_binary643.7
Applied associate-*l/_binary641.2
Simplified0.7
Final simplification0.7
herbie shell --seed 2021211
(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))))