\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\begin{array}{l}
\mathbf{if}\;y \cdot \left(1 + z \cdot z\right) \le 1.99426338026531584 \cdot 10^{307}:\\
\;\;\;\;\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{x} \cdot \sqrt[3]{x}}}{\frac{\left(\left({\left({y}^{\frac{1}{3}}\right)}^{3} \cdot z\right) \cdot z + 1 \cdot {\left({y}^{\frac{1}{3}}\right)}^{3}\right) \cdot \sqrt[3]{x}}{\sqrt[3]{1}}}\\
\end{array}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 VAR;
if (((y * (1.0 + (z * z))) <= 1.9942633802653158e+307)) {
VAR = ((1.0 / x) / (y * (1.0 + (z * z))));
} else {
VAR = (((cbrt(1.0) * cbrt(1.0)) / (cbrt(x) * cbrt(x))) / (((((pow(pow(y, 0.3333333333333333), 3.0) * z) * z) + (1.0 * pow(pow(y, 0.3333333333333333), 3.0))) * cbrt(x)) / cbrt(1.0)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 5.5 |
| Herbie | 5.1 |
if (* y (+ 1.0 (* z z))) < 1.9942633802653158e+307Initial program 3.9
if 1.9942633802653158e+307 < (* y (+ 1.0 (* z z))) Initial program 18.0
rmApplied add-cube-cbrt18.0
Applied add-cube-cbrt18.0
Applied times-frac18.0
Applied associate-/l*18.0
Simplified18.0
rmApplied add-cube-cbrt18.0
Applied associate-*l*18.0
rmApplied fma-udef18.0
Applied distribute-lft-in18.0
Applied distribute-lft-in18.0
Simplified11.4
Simplified11.4
Final simplification5.1
herbie shell --seed 2020092 +o rules:numerics
(FPCore (x y z)
:name "Statistics.Distribution.CauchyLorentz:$cdensity from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< (* y (+ 1 (* z z))) #f) (/ (/ 1 y) (* (+ 1 (* z z)) x)) (if (< (* y (+ 1 (* z z))) 8.680743250567252e+305) (/ (/ 1 x) (* (+ 1 (* z z)) y)) (/ (/ 1 y) (* (+ 1 (* z z)) x))))
(/ (/ 1 x) (* y (+ 1 (* z z)))))