\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.3341519654404754 \cdot 10^{-26} \lor \neg \left(z \le 20427325237287192\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 1}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r435721 = x;
double r435722 = y;
double r435723 = sin(r435722);
double r435724 = r435723 / r435722;
double r435725 = r435721 * r435724;
double r435726 = z;
double r435727 = r435725 / r435726;
return r435727;
}
double f(double x, double y, double z) {
double r435728 = z;
double r435729 = -3.3341519654404754e-26;
bool r435730 = r435728 <= r435729;
double r435731 = 2.042732523728719e+16;
bool r435732 = r435728 <= r435731;
double r435733 = !r435732;
bool r435734 = r435730 || r435733;
double r435735 = x;
double r435736 = y;
double r435737 = sin(r435736);
double r435738 = r435737 / r435736;
double r435739 = r435735 * r435738;
double r435740 = r435739 / r435728;
double r435741 = 1.0;
double r435742 = r435735 * r435741;
double r435743 = r435736 / r435737;
double r435744 = r435728 * r435743;
double r435745 = r435742 / r435744;
double r435746 = r435734 ? r435740 : r435745;
return r435746;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -3.3341519654404754e-26 or 2.042732523728719e+16 < z Initial program 0.1
if -3.3341519654404754e-26 < z < 2.042732523728719e+16Initial program 5.9
rmApplied clear-num6.0
rmApplied associate-*r/5.9
Applied associate-/l/0.2
Final simplification0.2
herbie shell --seed 2020036 +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))