\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.3412211236133659 \cdot 10^{-51} \lor \neg \left(z \le 9.6931285533073065 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r525826 = x;
double r525827 = y;
double r525828 = sin(r525827);
double r525829 = r525828 / r525827;
double r525830 = r525826 * r525829;
double r525831 = z;
double r525832 = r525830 / r525831;
return r525832;
}
double f(double x, double y, double z) {
double r525833 = z;
double r525834 = -2.341221123613366e-51;
bool r525835 = r525833 <= r525834;
double r525836 = 9.693128553307307e-43;
bool r525837 = r525833 <= r525836;
double r525838 = !r525837;
bool r525839 = r525835 || r525838;
double r525840 = x;
double r525841 = y;
double r525842 = sin(r525841);
double r525843 = 1.0;
double r525844 = r525843 / r525841;
double r525845 = r525842 * r525844;
double r525846 = r525840 * r525845;
double r525847 = r525846 / r525833;
double r525848 = r525842 / r525841;
double r525849 = r525848 / r525833;
double r525850 = r525840 * r525849;
double r525851 = r525839 ? r525847 : r525850;
return r525851;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if z < -2.341221123613366e-51 or 9.693128553307307e-43 < z Initial program 0.3
rmApplied div-inv0.4
if -2.341221123613366e-51 < z < 9.693128553307307e-43Initial program 6.9
rmApplied *-un-lft-identity6.9
Applied times-frac0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020083
(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))