\frac{\frac{1}{x}}{y \cdot \left(1 + z \cdot z\right)}\frac{\frac{1}{\sqrt[3]{x} \cdot \sqrt[3]{x}} \cdot \frac{\frac{1}{y}}{\left|\sqrt[3]{1 + z \cdot z}\right|}}{\sqrt{\sqrt[3]{1 + z \cdot z}} \cdot \left(\sqrt{1 + z \cdot z} \cdot \sqrt[3]{x}\right)}double code(double x, double y, double z) {
return ((double) (((double) (1.0 / x)) / ((double) (y * ((double) (1.0 + ((double) (z * z))))))));
}
double code(double x, double y, double z) {
return ((double) (((double) (((double) (1.0 / ((double) (((double) cbrt(x)) * ((double) cbrt(x)))))) * ((double) (((double) (1.0 / y)) / ((double) fabs(((double) cbrt(((double) (1.0 + ((double) (z * z)))))))))))) / ((double) (((double) sqrt(((double) cbrt(((double) (1.0 + ((double) (z * z)))))))) * ((double) (((double) sqrt(((double) (1.0 + ((double) (z * z)))))) * ((double) cbrt(x))))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 5.7 |
| Herbie | 6.2 |
Initial program 6.3
rmApplied add-sqr-sqrt6.3
Applied associate-*r*6.3
Applied div-inv6.3
Applied times-frac6.2
rmApplied add-cube-cbrt6.8
Applied associate-/r*6.8
Applied associate-/l/6.8
Applied add-cube-cbrt6.8
Applied sqrt-prod6.8
Applied associate-*r*6.8
Applied associate-/r*6.6
Applied frac-times6.2
Simplified6.2
Final simplification6.2
herbie shell --seed 2020113
(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)))))