\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.1728892342568057 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{elif}\;z \le 1.32101974044890363 \cdot 10^{187}:\\
\;\;\;\;\frac{x \cdot 1}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x}{\frac{y}{\sin y}}\right)}^{1} \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r572870 = x;
double r572871 = y;
double r572872 = sin(r572871);
double r572873 = r572872 / r572871;
double r572874 = r572870 * r572873;
double r572875 = z;
double r572876 = r572874 / r572875;
return r572876;
}
double f(double x, double y, double z) {
double r572877 = z;
double r572878 = -1.1728892342568057e-27;
bool r572879 = r572877 <= r572878;
double r572880 = x;
double r572881 = y;
double r572882 = sin(r572881);
double r572883 = 1.0;
double r572884 = r572883 / r572881;
double r572885 = r572882 * r572884;
double r572886 = r572880 * r572885;
double r572887 = r572886 / r572877;
double r572888 = 1.3210197404489036e+187;
bool r572889 = r572877 <= r572888;
double r572890 = r572880 * r572883;
double r572891 = r572881 / r572882;
double r572892 = r572877 * r572891;
double r572893 = r572890 / r572892;
double r572894 = r572880 / r572891;
double r572895 = pow(r572894, r572883);
double r572896 = r572883 / r572877;
double r572897 = r572895 * r572896;
double r572898 = r572889 ? r572893 : r572897;
double r572899 = r572879 ? r572887 : r572898;
return r572899;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 3.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if z < -1.1728892342568057e-27Initial program 0.2
rmApplied div-inv0.3
if -1.1728892342568057e-27 < z < 1.3210197404489036e+187Initial program 4.8
rmApplied clear-num4.9
rmApplied associate-*r/4.8
Applied associate-/l/1.1
if 1.3210197404489036e+187 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
rmApplied div-inv0.2
Final simplification0.8
herbie shell --seed 2020062
(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))