\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}
\begin{array}{l}
t_0 := \sqrt{y} \cdot \mathsf{hypot}\left(1, z\right)\\
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \leq 4.9570759986999974 \cdot 10^{+263}:\\
\;\;\;\;\frac{\frac{1}{y \cdot \mathsf{fma}\left(z, z, 1\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{t_0}}{t_0}\\
\end{array}
(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (sqrt y) (hypot 1.0 z))))
(if (<= (* y (+ 1.0 (* z z))) 4.9570759986999974e+263)
(/ (/ 1.0 (* y (fma z z 1.0))) x)
(/ (/ (/ 1.0 x) t_0) t_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(y) * hypot(1.0, z);
double tmp;
if ((y * (1.0 + (z * z))) <= 4.9570759986999974e+263) {
tmp = (1.0 / (y * fma(z, z, 1.0))) / x;
} else {
tmp = ((1.0 / x) / t_0) / t_0;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 6.5 |
|---|---|
| Target | 5.1 |
| Herbie | 1.6 |
if (*.f64 y (+.f64 1 (*.f64 z z))) < 4.95707599869999736e263Initial program 2.3
Simplified2.3
Applied egg-rr2.3
Applied egg-rr2.3
if 4.95707599869999736e263 < (*.f64 y (+.f64 1 (*.f64 z z))) Initial program 15.8
Simplified15.8
Applied egg-rr15.8
Applied egg-rr0.3
Final simplification1.6
herbie shell --seed 2022130
(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)))))