\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.2889274271188022 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\mathbf{elif}\;x \le 1.5442293158046647 \cdot 10^{+242}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r22854981 = x;
double r22854982 = y;
double r22854983 = sin(r22854982);
double r22854984 = r22854983 / r22854982;
double r22854985 = r22854981 * r22854984;
double r22854986 = z;
double r22854987 = r22854985 / r22854986;
return r22854987;
}
double f(double x, double y, double z) {
double r22854988 = x;
double r22854989 = -1.2889274271188022e+17;
bool r22854990 = r22854988 <= r22854989;
double r22854991 = y;
double r22854992 = sin(r22854991);
double r22854993 = r22854992 * r22854988;
double r22854994 = r22854993 / r22854991;
double r22854995 = z;
double r22854996 = r22854994 / r22854995;
double r22854997 = 1.5442293158046647e+242;
bool r22854998 = r22854988 <= r22854997;
double r22854999 = r22854992 / r22854991;
double r22855000 = r22854995 / r22854999;
double r22855001 = r22854988 / r22855000;
double r22855002 = r22854998 ? r22855001 : r22854996;
double r22855003 = r22854990 ? r22854996 : r22855002;
return r22855003;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.2 |
| Herbie | 1.0 |
if x < -1.2889274271188022e+17 or 1.5442293158046647e+242 < x Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied associate-/r*0.2
Simplified0.3
if -1.2889274271188022e+17 < x < 1.5442293158046647e+242Initial program 3.6
rmApplied associate-/l*1.3
Final simplification1.0
herbie shell --seed 2019158 +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))