\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.94523853728173715 \cdot 10^{77} \lor \neg \left(z \le 5.77037772052017817 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x}{z} \cdot \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 r367937 = x;
double r367938 = y;
double r367939 = sin(r367938);
double r367940 = r367939 / r367938;
double r367941 = r367937 * r367940;
double r367942 = z;
double r367943 = r367941 / r367942;
return r367943;
}
double f(double x, double y, double z) {
double r367944 = z;
double r367945 = -1.9452385372817372e+77;
bool r367946 = r367944 <= r367945;
double r367947 = 5.770377720520178e-08;
bool r367948 = r367944 <= r367947;
double r367949 = !r367948;
bool r367950 = r367946 || r367949;
double r367951 = x;
double r367952 = r367951 / r367944;
double r367953 = y;
double r367954 = sin(r367953);
double r367955 = r367954 / r367953;
double r367956 = r367952 * r367955;
double r367957 = r367944 / r367955;
double r367958 = r367951 / r367957;
double r367959 = r367950 ? r367956 : r367958;
return r367959;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if z < -1.9452385372817372e+77 or 5.770377720520178e-08 < z Initial program 0.1
rmApplied associate-/l*5.9
rmApplied associate-/r/0.1
if -1.9452385372817372e+77 < z < 5.770377720520178e-08Initial program 4.9
rmApplied associate-/l*0.5
Final simplification0.3
herbie shell --seed 2019199
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))