(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
(FPCore (x y z) :precision binary64 (if (<= (* z z) 2.47293109594615e+270) (* (/ (/ 1.0 y) x) (/ 1.0 (fma z z 1.0))) (/ (/ (/ 1.0 y) z) (* z x))))
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 tmp;
if ((z * z) <= 2.47293109594615e+270) {
tmp = ((1.0 / y) / x) * (1.0 / fma(z, z, 1.0));
} else {
tmp = ((1.0 / y) / z) / (z * x);
}
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) tmp = 0.0 if (Float64(z * z) <= 2.47293109594615e+270) tmp = Float64(Float64(Float64(1.0 / y) / x) * Float64(1.0 / fma(z, z, 1.0))); else tmp = Float64(Float64(Float64(1.0 / y) / z) / Float64(z * x)); 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_] := If[LessEqual[N[(z * z), $MachinePrecision], 2.47293109594615e+270], N[(N[(N[(1.0 / y), $MachinePrecision] / x), $MachinePrecision] * N[(1.0 / N[(z * z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] / z), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]]
\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 2.47293109594615 \cdot 10^{+270}:\\
\;\;\;\;\frac{\frac{1}{y}}{x} \cdot \frac{1}{\mathsf{fma}\left(z, z, 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{y}}{z}}{z \cdot x}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.1 |
|---|---|
| Target | 5.5 |
| Herbie | 1.7 |
if (*.f64 z z) < 2.47293109594615023e270Initial program 1.8
Taylor expanded in x around 0 2.2
Simplified2.0
Applied egg-rr1.8
if 2.47293109594615023e270 < (*.f64 z z) Initial program 16.1
Taylor expanded in z around inf 16.3
Simplified1.6
Final simplification1.7
herbie shell --seed 2022150
(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)))))