\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.800510743519484350282777849822879765183 \cdot 10^{60}:\\
\;\;\;\;\frac{\frac{\sin y}{y} \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin y \cdot \frac{1}{y}}{z} \cdot x\\
\end{array}double f(double x, double y, double z) {
double r353039 = x;
double r353040 = y;
double r353041 = sin(r353040);
double r353042 = r353041 / r353040;
double r353043 = r353039 * r353042;
double r353044 = z;
double r353045 = r353043 / r353044;
return r353045;
}
double f(double x, double y, double z) {
double r353046 = x;
double r353047 = -1.8005107435194844e+60;
bool r353048 = r353046 <= r353047;
double r353049 = y;
double r353050 = sin(r353049);
double r353051 = r353050 / r353049;
double r353052 = r353051 * r353046;
double r353053 = z;
double r353054 = r353052 / r353053;
double r353055 = 1.0;
double r353056 = r353055 / r353049;
double r353057 = r353050 * r353056;
double r353058 = r353057 / r353053;
double r353059 = r353058 * r353046;
double r353060 = r353048 ? r353054 : r353059;
return r353060;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if x < -1.8005107435194844e+60Initial program 0.2
Simplified8.3
rmApplied div-inv8.3
rmApplied associate-*r/0.3
Simplified0.2
if -1.8005107435194844e+60 < x Initial program 3.3
Simplified1.9
rmApplied div-inv1.9
Final simplification1.6
herbie shell --seed 2019174 +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))