\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -6.319714735762894040261866058671149783272 \cdot 10^{-124} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 6.641146027642848148772445195187677057815 \cdot 10^{-283}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r295997 = x;
double r295998 = y;
double r295999 = sin(r295998);
double r296000 = r295999 / r295998;
double r296001 = r295997 * r296000;
double r296002 = z;
double r296003 = r296001 / r296002;
return r296003;
}
double f(double x, double y, double z) {
double r296004 = x;
double r296005 = y;
double r296006 = sin(r296005);
double r296007 = r296006 / r296005;
double r296008 = r296004 * r296007;
double r296009 = -6.319714735762894e-124;
bool r296010 = r296008 <= r296009;
double r296011 = 6.641146027642848e-283;
bool r296012 = r296008 <= r296011;
double r296013 = !r296012;
bool r296014 = r296010 || r296013;
double r296015 = z;
double r296016 = r296008 / r296015;
double r296017 = r296004 / r296015;
double r296018 = r296005 / r296006;
double r296019 = r296017 / r296018;
double r296020 = r296014 ? r296016 : r296019;
return r296020;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if (* x (/ (sin y) y)) < -6.319714735762894e-124 or 6.641146027642848e-283 < (* x (/ (sin y) y)) Initial program 0.2
if -6.319714735762894e-124 < (* x (/ (sin y) y)) < 6.641146027642848e-283Initial program 8.0
rmApplied associate-/l*0.7
Simplified0.7
rmApplied associate-/r*0.5
Final simplification0.3
herbie shell --seed 2019325 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
: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))