\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\frac{\sin y}{y} \cdot x}{z} \le -5.699216469332027 \cdot 10^{+44}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{elif}\;\frac{\frac{\sin y}{y} \cdot x}{z} \le 3.1854679199390606 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r27020937 = x;
double r27020938 = y;
double r27020939 = sin(r27020938);
double r27020940 = r27020939 / r27020938;
double r27020941 = r27020937 * r27020940;
double r27020942 = z;
double r27020943 = r27020941 / r27020942;
return r27020943;
}
double f(double x, double y, double z) {
double r27020944 = y;
double r27020945 = sin(r27020944);
double r27020946 = r27020945 / r27020944;
double r27020947 = x;
double r27020948 = r27020946 * r27020947;
double r27020949 = z;
double r27020950 = r27020948 / r27020949;
double r27020951 = -5.699216469332027e+44;
bool r27020952 = r27020950 <= r27020951;
double r27020953 = r27020949 / r27020946;
double r27020954 = r27020947 / r27020953;
double r27020955 = 3.1854679199390606e-55;
bool r27020956 = r27020950 <= r27020955;
double r27020957 = r27020947 / r27020949;
double r27020958 = 1.0;
double r27020959 = r27020958 / r27020946;
double r27020960 = r27020957 / r27020959;
double r27020961 = r27020956 ? r27020960 : r27020954;
double r27020962 = r27020952 ? r27020954 : r27020961;
return r27020962;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 3.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if (/ (* x (/ (sin y) y)) z) < -5.699216469332027e+44 or 3.1854679199390606e-55 < (/ (* x (/ (sin y) y)) z) Initial program 0.2
rmApplied associate-/l*0.4
if -5.699216469332027e+44 < (/ (* x (/ (sin y) y)) z) < 3.1854679199390606e-55Initial program 4.4
rmApplied associate-/l*3.9
rmApplied div-inv3.9
Applied associate-/r*0.2
Final simplification0.3
herbie shell --seed 2019164
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
: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))