\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -63423026121534586243447259136:\\
\;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\
\mathbf{elif}\;x \le 8.079582008954303854545151585771577035848 \cdot 10^{61}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{y}{\sin y \cdot x}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r21942031 = x;
double r21942032 = y;
double r21942033 = sin(r21942032);
double r21942034 = r21942033 / r21942032;
double r21942035 = r21942031 * r21942034;
double r21942036 = z;
double r21942037 = r21942035 / r21942036;
return r21942037;
}
double f(double x, double y, double z) {
double r21942038 = x;
double r21942039 = -6.342302612153459e+28;
bool r21942040 = r21942038 <= r21942039;
double r21942041 = 1.0;
double r21942042 = y;
double r21942043 = sin(r21942042);
double r21942044 = r21942042 / r21942043;
double r21942045 = r21942041 / r21942044;
double r21942046 = r21942045 * r21942038;
double r21942047 = z;
double r21942048 = r21942046 / r21942047;
double r21942049 = 8.079582008954304e+61;
bool r21942050 = r21942038 <= r21942049;
double r21942051 = r21942043 / r21942042;
double r21942052 = r21942047 / r21942051;
double r21942053 = r21942038 / r21942052;
double r21942054 = r21942043 * r21942038;
double r21942055 = r21942042 / r21942054;
double r21942056 = r21942041 / r21942055;
double r21942057 = r21942056 / r21942047;
double r21942058 = r21942050 ? r21942053 : r21942057;
double r21942059 = r21942040 ? r21942048 : r21942058;
return r21942059;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -6.342302612153459e+28Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied associate-/r*0.2
Simplified0.2
rmApplied div-inv0.3
if -6.342302612153459e+28 < x < 8.079582008954304e+61Initial program 4.5
rmApplied associate-/l*0.3
if 8.079582008954304e+61 < x Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied associate-/r*0.2
Simplified0.3
rmApplied div-inv0.4
rmApplied clear-num0.5
Simplified0.4
Final simplification0.3
herbie shell --seed 2019192
(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))