\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.28657606638248286 \cdot 10^{-6} \lor \neg \left(z \le 1.7877667366727078 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r454858 = x;
double r454859 = y;
double r454860 = sin(r454859);
double r454861 = r454860 / r454859;
double r454862 = r454858 * r454861;
double r454863 = z;
double r454864 = r454862 / r454863;
return r454864;
}
double f(double x, double y, double z) {
double r454865 = z;
double r454866 = -2.286576066382483e-06;
bool r454867 = r454865 <= r454866;
double r454868 = 1.7877667366727078e-79;
bool r454869 = r454865 <= r454868;
double r454870 = !r454869;
bool r454871 = r454867 || r454870;
double r454872 = x;
double r454873 = y;
double r454874 = sin(r454873);
double r454875 = 1.0;
double r454876 = r454875 / r454873;
double r454877 = r454874 * r454876;
double r454878 = r454872 * r454877;
double r454879 = r454878 / r454865;
double r454880 = r454874 / r454873;
double r454881 = r454865 / r454880;
double r454882 = r454872 / r454881;
double r454883 = r454871 ? r454879 : r454882;
return r454883;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if z < -2.286576066382483e-06 or 1.7877667366727078e-79 < z Initial program 0.3
rmApplied div-inv0.4
if -2.286576066382483e-06 < z < 1.7877667366727078e-79Initial program 6.5
rmApplied associate-/l*0.2
Final simplification0.3
herbie shell --seed 2020100 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))