\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\begin{array}{l}
\mathbf{if}\;\frac{1}{x} \leq -410859949002324.94:\\
\;\;\;\;{\left(y \cdot \left(x + z \cdot \left(x \cdot z\right)\right)\right)}^{-1}\\
\mathbf{elif}\;\frac{1}{x} \leq 0.47775306239330895:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{y}}{1 + z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{y}}{x + z \cdot \left(x \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 (<= (/ 1.0 x) -410859949002324.94)
(pow (* y (+ x (* z (* x z)))) -1.0)
(if (<= (/ 1.0 x) 0.47775306239330895)
(/ (/ (/ 1.0 x) y) (+ 1.0 (* z z)))
(/ (/ 1.0 y) (+ x (* z (* x 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) <= -410859949002324.94) {
tmp = pow((y * (x + (z * (x * z)))), -1.0);
} else if ((1.0 / x) <= 0.47775306239330895) {
tmp = ((1.0 / x) / y) / (1.0 + (z * z));
} else {
tmp = (1.0 / y) / (x + (z * (x * z)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.6 |
|---|---|
| Target | 5.2 |
| Herbie | 2.5 |
if (/.f64 1 x) < -410859949002324.938Initial program 14.0
rmApplied *-un-lft-identity_binary64_1064914.0
Applied add-sqr-sqrt_binary64_1067114.0
Applied times-frac_binary64_1065514.0
Applied times-frac_binary64_1065511.6
Simplified11.6
Simplified11.5
rmApplied associate-*r*_binary64_105894.7
rmApplied inv-pow_binary64_107344.7
Applied inv-pow_binary64_107344.7
Applied pow-prod-down_binary64_107204.7
if -410859949002324.938 < (/.f64 1 x) < 0.47775306239330895Initial program 1.9
rmApplied associate-/r*_binary64_105931.9
Simplified2.2
rmApplied associate-/r*_binary64_105931.9
if 0.47775306239330895 < (/.f64 1 x) Initial program 10.6
rmApplied *-un-lft-identity_binary64_1064910.6
Applied add-sqr-sqrt_binary64_1067110.6
Applied times-frac_binary64_1065510.6
Applied times-frac_binary64_106556.6
Simplified6.6
Simplified6.6
rmApplied associate-*r*_binary64_105891.0
rmApplied un-div-inv_binary64_106470.9
Final simplification2.5
herbie shell --seed 2021090
(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)))))