(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sqrt (fma z z 1.0))))
(if (<= y 3.958220094131283e-17)
(/ (/ 1.0 x) (+ (* (* t_0 y) t_0) (fma 0.0 y (* 0.0 y))))
(/ (/ (/ 1.0 x) y) (fma z z 1.0)))))double code(double x, double y, double z) {
return (1.0 / x) / (y * (1.0 + (z * z)));
}
double code(double x, double y, double z) {
double t_0 = sqrt(fma(z, z, 1.0));
double tmp;
if (y <= 3.958220094131283e-17) {
tmp = (1.0 / x) / (((t_0 * y) * t_0) + fma(0.0, y, (0.0 * y)));
} else {
tmp = ((1.0 / x) / y) / fma(z, z, 1.0);
}
return tmp;
}
function code(x, y, z) return Float64(Float64(1.0 / x) / Float64(y * Float64(1.0 + Float64(z * z)))) end
function code(x, y, z) t_0 = sqrt(fma(z, z, 1.0)) tmp = 0.0 if (y <= 3.958220094131283e-17) tmp = Float64(Float64(1.0 / x) / Float64(Float64(Float64(t_0 * y) * t_0) + fma(0.0, y, Float64(0.0 * y)))); else tmp = Float64(Float64(Float64(1.0 / x) / y) / fma(z, z, 1.0)); end return tmp end
code[x_, y_, z_] := N[(N[(1.0 / x), $MachinePrecision] / N[(y * N[(1.0 + N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[Sqrt[N[(z * z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.958220094131283e-17], N[(N[(1.0 / x), $MachinePrecision] / N[(N[(N[(t$95$0 * y), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(0.0 * y + N[(0.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision] / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]]]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{if}\;y \leq 3.958220094131283 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{1}{x}}{\left(t_0 \cdot y\right) \cdot t_0 + \mathsf{fma}\left(0, y, 0 \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{y}}{\mathsf{fma}\left(z, z, 1\right)}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.4 |
|---|---|
| Target | 4.9 |
| Herbie | 5.0 |
if y < 3.9582200941312828e-17Initial program 8.0
Simplified8.0
Applied egg-rr8.0
Applied egg-rr8.0
if 3.9582200941312828e-17 < y Initial program 4.8
Simplified4.8
Applied egg-rr4.9
Applied egg-rr1.9
Final simplification5.0
herbie shell --seed 2022131
(FPCore (x y z)
:name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< (* y (+ 1.0 (* z z))) (- INFINITY)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x)) (if (< (* y (+ 1.0 (* z z))) 8.680743250567252e+305) (/ (/ 1.0 x) (* (+ 1.0 (* z z)) y)) (/ (/ 1.0 y) (* (+ 1.0 (* z z)) x))))
(/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))