\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.126929288024238297232353227899211696157 \cdot 10^{139}:\\
\;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\
\mathbf{elif}\;z \le 7.288354638204399615341079828710618574231 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r585850 = x;
double r585851 = y;
double r585852 = sin(r585851);
double r585853 = r585852 / r585851;
double r585854 = r585850 * r585853;
double r585855 = z;
double r585856 = r585854 / r585855;
return r585856;
}
double f(double x, double y, double z) {
double r585857 = z;
double r585858 = -3.1269292880242383e+139;
bool r585859 = r585857 <= r585858;
double r585860 = x;
double r585861 = 1.0;
double r585862 = y;
double r585863 = sin(r585862);
double r585864 = r585862 / r585863;
double r585865 = r585861 / r585864;
double r585866 = r585860 * r585865;
double r585867 = r585866 / r585857;
double r585868 = 7.2883546382044e-12;
bool r585869 = r585857 <= r585868;
double r585870 = r585857 * r585864;
double r585871 = r585860 / r585870;
double r585872 = r585863 / r585862;
double r585873 = r585860 * r585872;
double r585874 = r585861 / r585857;
double r585875 = r585873 * r585874;
double r585876 = r585869 ? r585871 : r585875;
double r585877 = r585859 ? r585867 : r585876;
return r585877;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if z < -3.1269292880242383e+139Initial program 0.1
rmApplied clear-num0.1
if -3.1269292880242383e+139 < z < 7.2883546382044e-12Initial program 4.9
rmApplied associate-/l*0.8
Simplified0.8
if 7.2883546382044e-12 < z Initial program 0.1
rmApplied div-inv0.2
Final simplification0.5
herbie shell --seed 2019350 +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))