\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{x} \leq -7.533396507028953 \cdot 10^{-29} \lor \neg \left(\frac{1}{x} \leq -6.450279130107457 \cdot 10^{-261}\right):\\
\;\;\;\;\frac{\frac{1}{y}}{x + z \cdot \left(x \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{\sqrt{1 + z \cdot z} \cdot \left(y \cdot \sqrt{1 + z \cdot z}\right)}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (/ 1.0 x) (* y (+ 1.0 (* z z)))))
(FPCore (x y z)
:precision binary64
(if (or (<= (/ 1.0 x) -7.533396507028953e-29)
(not (<= (/ 1.0 x) -6.450279130107457e-261)))
(/ (/ 1.0 y) (+ x (* z (* x z))))
(/ (/ 1.0 x) (* (sqrt (+ 1.0 (* z z))) (* y (sqrt (+ 1.0 (* z 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 tmp;
if (((1.0 / x) <= -7.533396507028953e-29) || !((1.0 / x) <= -6.450279130107457e-261)) {
tmp = (1.0 / y) / (x + (z * (x * z)));
} else {
tmp = (1.0 / x) / (sqrt(1.0 + (z * z)) * (y * sqrt(1.0 + (z * z))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.7 |
|---|---|
| Target | 5.2 |
| Herbie | 2.7 |
if (/.f64 1 x) < -7.5333965070289534e-29 or -6.45027913010745728e-261 < (/.f64 1 x) Initial program 9.4
rmApplied *-un-lft-identity_binary64_109909.4
Applied add-sqr-sqrt_binary64_110129.4
Applied times-frac_binary64_109969.4
Applied times-frac_binary64_109967.6
Simplified7.6
Simplified7.7
rmApplied associate-*l*_binary64_109313.4
Simplified3.4
rmApplied un-div-inv_binary64_109883.3
if -7.5333965070289534e-29 < (/.f64 1 x) < -6.45027913010745728e-261Initial program 1.5
rmApplied add-sqr-sqrt_binary64_110121.6
Applied associate-*r*_binary64_109301.6
Final simplification2.7
herbie shell --seed 2021096
(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)))))