(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 (/ (* (/ z y) (+ 1.0 z)) x)))))
(if (<= (* x y) 4.586543263181661e-282)
t_0
(if (<= (* x y) 2.8102311057491402e+138)
(/ (/ (* x y) (fma z z z)) z)
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 * (((z / y) * (1.0 + z)) / x));
double tmp;
if ((x * y) <= 4.586543263181661e-282) {
tmp = t_0;
} else if ((x * y) <= 2.8102311057491402e+138) {
tmp = ((x * y) / fma(z, z, z)) / z;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) return Float64(Float64(x * y) / Float64(Float64(z * z) * Float64(z + 1.0))) end
function code(x, y, z) t_0 = Float64(1.0 / Float64(z * Float64(Float64(Float64(z / y) * Float64(1.0 + z)) / x))) tmp = 0.0 if (Float64(x * y) <= 4.586543263181661e-282) tmp = t_0; elseif (Float64(x * y) <= 2.8102311057491402e+138) tmp = Float64(Float64(Float64(x * y) / fma(z, z, z)) / z); else tmp = t_0; end return tmp end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] / N[(N[(z * z), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 / N[(z * N[(N[(N[(z / y), $MachinePrecision] * N[(1.0 + z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], 4.586543263181661e-282], t$95$0, If[LessEqual[N[(x * y), $MachinePrecision], 2.8102311057491402e+138], N[(N[(N[(x * y), $MachinePrecision] / N[(z * z + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\frac{x \cdot y}{\left(z \cdot z\right) \cdot \left(z + 1\right)}
\begin{array}{l}
t_0 := \frac{1}{z \cdot \frac{\frac{z}{y} \cdot \left(1 + z\right)}{x}}\\
\mathbf{if}\;x \cdot y \leq 4.586543263181661 \cdot 10^{-282}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot y \leq 2.8102311057491402 \cdot 10^{+138}:\\
\;\;\;\;\frac{\frac{x \cdot y}{\mathsf{fma}\left(z, z, z\right)}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 14.7 |
|---|---|
| Target | 4.2 |
| Herbie | 2.6 |
if (*.f64 x y) < 4.5865432631816612e-282 or 2.8102311057491402e138 < (*.f64 x y) Initial program 18.6
Simplified9.2
Applied egg-rr6.3
Applied egg-rr6.2
Taylor expanded in z around 0 11.2
Simplified3.7
if 4.5865432631816612e-282 < (*.f64 x y) < 2.8102311057491402e138Initial program 5.5
Simplified6.6
Applied egg-rr2.1
Applied egg-rr0.2
Final simplification2.6
herbie shell --seed 2022133
(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))))