\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5593196487055916383862784:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\mathbf{elif}\;z \le 0.001397275382843652952874480277500879310537:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r21912975 = x;
double r21912976 = y;
double r21912977 = sin(r21912976);
double r21912978 = r21912977 / r21912976;
double r21912979 = r21912975 * r21912978;
double r21912980 = z;
double r21912981 = r21912979 / r21912980;
return r21912981;
}
double f(double x, double y, double z) {
double r21912982 = z;
double r21912983 = -5.593196487055916e+24;
bool r21912984 = r21912982 <= r21912983;
double r21912985 = x;
double r21912986 = 1.0;
double r21912987 = y;
double r21912988 = r21912986 / r21912987;
double r21912989 = sin(r21912987);
double r21912990 = r21912986 / r21912989;
double r21912991 = r21912988 / r21912990;
double r21912992 = r21912985 * r21912991;
double r21912993 = r21912992 / r21912982;
double r21912994 = 0.001397275382843653;
bool r21912995 = r21912982 <= r21912994;
double r21912996 = r21912989 / r21912987;
double r21912997 = r21912982 / r21912996;
double r21912998 = r21912985 / r21912997;
double r21912999 = r21912995 ? r21912998 : r21912993;
double r21913000 = r21912984 ? r21912993 : r21912999;
return r21913000;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -5.593196487055916e+24 or 0.001397275382843653 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied div-inv0.2
Applied associate-/r*0.2
if -5.593196487055916e+24 < z < 0.001397275382843653Initial program 5.7
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019172
(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))