(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 x))) (t_1 (* y (hypot 1.0 z))))
(if (<= (/ 1.0 x) -8.457177207248513e-25)
(* (/ 1.0 t_1) (/ (/ 1.0 x) (hypot 1.0 z)))
(if (<= (/ 1.0 x) 7.441329606809936e+219)
(/ (/ (/ 1.0 x) y) (fma z z 1.0))
(* (/ t_0 t_1) (/ t_0 (hypot 1.0 z)))))))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((1.0 / x));
double t_1 = y * hypot(1.0, z);
double tmp;
if ((1.0 / x) <= -8.457177207248513e-25) {
tmp = (1.0 / t_1) * ((1.0 / x) / hypot(1.0, z));
} else if ((1.0 / x) <= 7.441329606809936e+219) {
tmp = ((1.0 / x) / y) / fma(z, z, 1.0);
} else {
tmp = (t_0 / t_1) * (t_0 / hypot(1.0, z));
}
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(Float64(1.0 / x)) t_1 = Float64(y * hypot(1.0, z)) tmp = 0.0 if (Float64(1.0 / x) <= -8.457177207248513e-25) tmp = Float64(Float64(1.0 / t_1) * Float64(Float64(1.0 / x) / hypot(1.0, z))); elseif (Float64(1.0 / x) <= 7.441329606809936e+219) tmp = Float64(Float64(Float64(1.0 / x) / y) / fma(z, z, 1.0)); else tmp = Float64(Float64(t_0 / t_1) * Float64(t_0 / hypot(1.0, z))); 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[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y * N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / x), $MachinePrecision], -8.457177207248513e-25], N[(N[(1.0 / t$95$1), $MachinePrecision] * N[(N[(1.0 / x), $MachinePrecision] / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / x), $MachinePrecision], 7.441329606809936e+219], N[(N[(N[(1.0 / x), $MachinePrecision] / y), $MachinePrecision] / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / t$95$1), $MachinePrecision] * N[(t$95$0 / N[Sqrt[1.0 ^ 2 + z ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
t_0 := \sqrt{\frac{1}{x}}\\
t_1 := y \cdot \mathsf{hypot}\left(1, z\right)\\
\mathbf{if}\;\frac{1}{x} \leq -8.457177207248513 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{t_1} \cdot \frac{\frac{1}{x}}{\mathsf{hypot}\left(1, z\right)}\\
\mathbf{elif}\;\frac{1}{x} \leq 7.441329606809936 \cdot 10^{+219}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{y}}{\mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{t_1} \cdot \frac{t_0}{\mathsf{hypot}\left(1, z\right)}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.4 |
|---|---|
| Target | 4.9 |
| Herbie | 1.8 |
if (/.f64 1 x) < -8.4571772072485133e-25Initial program 12.4
Simplified12.4
Applied add-sqr-sqrt_binary6412.4
Applied associate-*r*_binary6412.4
Simplified12.4
Applied *-un-lft-identity_binary6412.4
Applied add-cube-cbrt_binary6412.4
Applied times-frac_binary6412.4
Applied times-frac_binary6411.0
Simplified11.0
Simplified1.5
if -8.4571772072485133e-25 < (/.f64 1 x) < 7.4413296068099356e219Initial program 2.4
Simplified2.4
Applied associate-/r*_binary641.8
if 7.4413296068099356e219 < (/.f64 1 x) Initial program 19.6
Simplified19.6
Applied add-sqr-sqrt_binary6419.6
Applied associate-*r*_binary6419.6
Simplified19.6
Applied add-sqr-sqrt_binary6419.8
Applied times-frac_binary6416.4
Simplified4.3
Final simplification1.8
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)))))