\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 3.883506706037952 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r22090063 = x;
double r22090064 = y;
double r22090065 = sin(r22090064);
double r22090066 = r22090065 / r22090064;
double r22090067 = r22090063 * r22090066;
double r22090068 = z;
double r22090069 = r22090067 / r22090068;
return r22090069;
}
double f(double x, double y, double z) {
double r22090070 = x;
double r22090071 = 3.883506706037952e-64;
bool r22090072 = r22090070 <= r22090071;
double r22090073 = z;
double r22090074 = y;
double r22090075 = sin(r22090074);
double r22090076 = r22090075 / r22090074;
double r22090077 = r22090073 / r22090076;
double r22090078 = r22090070 / r22090077;
double r22090079 = 1.0;
double r22090080 = r22090070 * r22090076;
double r22090081 = r22090073 / r22090080;
double r22090082 = r22090079 / r22090081;
double r22090083 = r22090072 ? r22090078 : r22090082;
return r22090083;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.8 |
if x < 3.883506706037952e-64Initial program 3.7
rmApplied associate-/l*2.1
if 3.883506706037952e-64 < x Initial program 0.5
rmApplied clear-num0.9
Final simplification1.8
herbie shell --seed 2019163 +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 (/ 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))