\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 3.883506706037952 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r21068787 = x;
double r21068788 = y;
double r21068789 = sin(r21068788);
double r21068790 = r21068789 / r21068788;
double r21068791 = r21068787 * r21068790;
double r21068792 = z;
double r21068793 = r21068791 / r21068792;
return r21068793;
}
double f(double x, double y, double z) {
double r21068794 = x;
double r21068795 = 3.883506706037952e-64;
bool r21068796 = r21068794 <= r21068795;
double r21068797 = z;
double r21068798 = y;
double r21068799 = sin(r21068798);
double r21068800 = r21068799 / r21068798;
double r21068801 = r21068797 / r21068800;
double r21068802 = r21068794 / r21068801;
double r21068803 = 1.0;
double r21068804 = r21068794 * r21068800;
double r21068805 = r21068797 / r21068804;
double r21068806 = r21068803 / r21068805;
double r21068807 = r21068796 ? r21068802 : r21068806;
return r21068807;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.8 |
if x < 3.883506706037952e-64Initial program 3.7
rmApplied associate-/l*2.1
if 3.883506706037952e-64 < x Initial program 0.5
rmApplied clear-num0.9
Final simplification1.8
herbie shell --seed 2019163
(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))