\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -50225608.0783285126:\\
\;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{1}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r526875 = x;
double r526876 = y;
double r526877 = sin(r526876);
double r526878 = r526877 / r526876;
double r526879 = r526875 * r526878;
double r526880 = z;
double r526881 = r526879 / r526880;
return r526881;
}
double f(double x, double y, double z) {
double r526882 = z;
double r526883 = -50225608.07832851;
bool r526884 = r526882 <= r526883;
double r526885 = x;
double r526886 = y;
double r526887 = sin(r526886);
double r526888 = r526885 * r526887;
double r526889 = 1.0;
double r526890 = r526889 / r526886;
double r526891 = r526888 * r526890;
double r526892 = r526891 / r526882;
double r526893 = r526887 / r526886;
double r526894 = r526889 / r526893;
double r526895 = r526882 * r526894;
double r526896 = r526885 / r526895;
double r526897 = r526884 ? r526892 : r526896;
return r526897;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.4 |
| Herbie | 2.3 |
if z < -50225608.07832851Initial program 0.1
rmApplied div-inv0.2
Applied associate-*r*2.5
if -50225608.07832851 < z Initial program 3.8
rmApplied associate-/l*2.2
rmApplied div-inv2.3
Final simplification2.3
herbie shell --seed 2020020 +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))