\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.0552052215129959 \cdot 10^{82}:\\
\;\;\;\;\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}\\
\mathbf{elif}\;x \le 3.1288782285340333 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r331939 = x;
double r331940 = y;
double r331941 = sin(r331940);
double r331942 = r331941 / r331940;
double r331943 = r331939 * r331942;
double r331944 = z;
double r331945 = r331943 / r331944;
return r331945;
}
double f(double x, double y, double z) {
double r331946 = x;
double r331947 = -1.055205221512996e+82;
bool r331948 = r331946 <= r331947;
double r331949 = y;
double r331950 = sin(r331949);
double r331951 = r331950 / r331949;
double r331952 = r331946 * r331951;
double r331953 = 1.0;
double r331954 = z;
double r331955 = r331953 / r331954;
double r331956 = r331952 * r331955;
double r331957 = 3.1288782285340333e-49;
bool r331958 = r331946 <= r331957;
double r331959 = r331954 / r331951;
double r331960 = r331946 / r331959;
double r331961 = r331946 * r331950;
double r331962 = r331961 / r331949;
double r331963 = r331962 / r331954;
double r331964 = r331958 ? r331960 : r331963;
double r331965 = r331948 ? r331956 : r331964;
return r331965;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if x < -1.055205221512996e+82Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac6.9
Simplified6.9
rmApplied div-inv6.9
Applied associate-*r*0.3
if -1.055205221512996e+82 < x < 3.1288782285340333e-49Initial program 4.7
rmApplied associate-/l*0.5
if 3.1288782285340333e-49 < x Initial program 0.3
rmApplied associate-*r/0.6
Final simplification0.5
herbie shell --seed 2020003
(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))