\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -73.32412333836710160994698526337742805481:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\mathbf{elif}\;x \le 81734465129316319031031597148521103360:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r17900755 = x;
double r17900756 = y;
double r17900757 = sin(r17900756);
double r17900758 = r17900757 / r17900756;
double r17900759 = r17900755 * r17900758;
double r17900760 = z;
double r17900761 = r17900759 / r17900760;
return r17900761;
}
double f(double x, double y, double z) {
double r17900762 = x;
double r17900763 = -73.3241233383671;
bool r17900764 = r17900762 <= r17900763;
double r17900765 = y;
double r17900766 = sin(r17900765);
double r17900767 = r17900766 * r17900762;
double r17900768 = r17900767 / r17900765;
double r17900769 = z;
double r17900770 = r17900768 / r17900769;
double r17900771 = 8.173446512931632e+37;
bool r17900772 = r17900762 <= r17900771;
double r17900773 = r17900766 / r17900765;
double r17900774 = r17900769 / r17900773;
double r17900775 = r17900762 / r17900774;
double r17900776 = r17900772 ? r17900775 : r17900770;
double r17900777 = r17900764 ? r17900770 : r17900776;
return r17900777;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -73.3241233383671 or 8.173446512931632e+37 < x Initial program 0.2
rmApplied div-inv0.4
rmApplied associate-*r/0.2
Simplified0.3
if -73.3241233383671 < x < 8.173446512931632e+37Initial program 4.3
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019171 +o rules:numerics
(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))