\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.9751805342320895 \cdot 10^{-52} \lor \neg \left(z \le 60113221.3286090866\right):\\
\;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{\frac{\sin y}{y}}}{x}}\\
\end{array}double f(double x, double y, double z) {
double r288163 = x;
double r288164 = y;
double r288165 = sin(r288164);
double r288166 = r288165 / r288164;
double r288167 = r288163 * r288166;
double r288168 = z;
double r288169 = r288167 / r288168;
return r288169;
}
double f(double x, double y, double z) {
double r288170 = z;
double r288171 = -2.9751805342320895e-52;
bool r288172 = r288170 <= r288171;
double r288173 = 60113221.32860909;
bool r288174 = r288170 <= r288173;
double r288175 = !r288174;
bool r288176 = r288172 || r288175;
double r288177 = y;
double r288178 = sin(r288177);
double r288179 = r288178 / r288177;
double r288180 = x;
double r288181 = r288179 * r288180;
double r288182 = r288181 / r288170;
double r288183 = 1.0;
double r288184 = r288170 / r288179;
double r288185 = r288184 / r288180;
double r288186 = r288183 / r288185;
double r288187 = r288176 ? r288182 : r288186;
return r288187;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if z < -2.9751805342320895e-52 or 60113221.32860909 < z Initial program 0.1
rmApplied div-inv0.2
rmApplied *-un-lft-identity0.2
Applied associate-*l*0.2
Simplified0.1
if -2.9751805342320895e-52 < z < 60113221.32860909Initial program 6.0
rmApplied div-inv6.1
rmApplied clear-num6.2
Simplified0.5
Final simplification0.3
herbie shell --seed 2019199 +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))