\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.6132281232836582 \cdot 10^{177} \lor \neg \left(z \le 99581.014851795189\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r321825 = x;
double r321826 = y;
double r321827 = sin(r321826);
double r321828 = r321827 / r321826;
double r321829 = r321825 * r321828;
double r321830 = z;
double r321831 = r321829 / r321830;
return r321831;
}
double f(double x, double y, double z) {
double r321832 = z;
double r321833 = -2.613228123283658e+177;
bool r321834 = r321832 <= r321833;
double r321835 = 99581.01485179519;
bool r321836 = r321832 <= r321835;
double r321837 = !r321836;
bool r321838 = r321834 || r321837;
double r321839 = x;
double r321840 = y;
double r321841 = sin(r321840);
double r321842 = r321841 / r321840;
double r321843 = r321839 * r321842;
double r321844 = r321843 / r321832;
double r321845 = r321832 / r321842;
double r321846 = r321839 / r321845;
double r321847 = r321838 ? r321844 : r321846;
return r321847;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if z < -2.613228123283658e+177 or 99581.01485179519 < z Initial program 0.1
rmApplied *-un-lft-identity0.1
if -2.613228123283658e+177 < z < 99581.01485179519Initial program 4.1
rmApplied associate-/l*1.1
Final simplification0.7
herbie shell --seed 2019198
(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))