\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.155566547691587058014765982566123084784 \cdot 10^{-290} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.212547594237189431415383106313707223784 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r399824 = x;
double r399825 = y;
double r399826 = sin(r399825);
double r399827 = r399826 / r399825;
double r399828 = r399824 * r399827;
double r399829 = z;
double r399830 = r399828 / r399829;
return r399830;
}
double f(double x, double y, double z) {
double r399831 = x;
double r399832 = y;
double r399833 = sin(r399832);
double r399834 = r399833 / r399832;
double r399835 = r399831 * r399834;
double r399836 = -2.155566547691587e-290;
bool r399837 = r399835 <= r399836;
double r399838 = 2.2125475942371894e-152;
bool r399839 = r399835 <= r399838;
double r399840 = !r399839;
bool r399841 = r399837 || r399840;
double r399842 = 1.0;
double r399843 = r399832 / r399833;
double r399844 = r399842 / r399843;
double r399845 = r399831 * r399844;
double r399846 = r399842 * r399845;
double r399847 = z;
double r399848 = r399846 / r399847;
double r399849 = r399847 / r399834;
double r399850 = r399831 / r399849;
double r399851 = r399841 ? r399848 : r399850;
return r399851;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if (* x (/ (sin y) y)) < -2.155566547691587e-290 or 2.2125475942371894e-152 < (* x (/ (sin y) y)) Initial program 0.2
rmApplied clear-num0.2
rmApplied *-un-lft-identity0.2
Applied associate-*l*0.2
Simplified0.2
rmApplied div-inv0.2
if -2.155566547691587e-290 < (* x (/ (sin y) y)) < 2.2125475942371894e-152Initial program 8.7
rmApplied associate-/l*0.6
Final simplification0.3
herbie shell --seed 2019354 +o rules:numerics
(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))