\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -1.667800433775549790266656174829587494332 \cdot 10^{-292} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 0.0\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \sin y}{z \cdot y}\\
\end{array}double f(double x, double y, double z) {
double r439050 = x;
double r439051 = y;
double r439052 = sin(r439051);
double r439053 = r439052 / r439051;
double r439054 = r439050 * r439053;
double r439055 = z;
double r439056 = r439054 / r439055;
return r439056;
}
double f(double x, double y, double z) {
double r439057 = x;
double r439058 = y;
double r439059 = sin(r439058);
double r439060 = r439059 / r439058;
double r439061 = r439057 * r439060;
double r439062 = -1.6678004337755498e-292;
bool r439063 = r439061 <= r439062;
double r439064 = 0.0;
bool r439065 = r439061 <= r439064;
double r439066 = !r439065;
bool r439067 = r439063 || r439066;
double r439068 = z;
double r439069 = r439061 / r439068;
double r439070 = r439057 * r439059;
double r439071 = r439068 * r439058;
double r439072 = r439070 / r439071;
double r439073 = r439067 ? r439069 : r439072;
return r439073;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if (* x (/ (sin y) y)) < -1.6678004337755498e-292 or 0.0 < (* x (/ (sin y) y)) Initial program 1.5
rmApplied add-cube-cbrt2.4
Applied times-frac3.2
rmApplied frac-times2.4
Simplified1.5
if -1.6678004337755498e-292 < (* x (/ (sin y) y)) < 0.0Initial program 14.5
rmApplied add-cube-cbrt14.6
Applied times-frac0.5
rmApplied frac-times14.6
Simplified14.5
rmApplied div-inv14.5
rmApplied associate-*r/17.9
Applied frac-times3.6
Simplified3.6
Simplified3.6
Final simplification0.5
herbie shell --seed 2019303
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))