\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -1.371660816435320975638711159936380278311 \cdot 10^{-137}:\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r261635 = x;
double r261636 = y;
double r261637 = sin(r261636);
double r261638 = r261637 / r261636;
double r261639 = r261635 * r261638;
double r261640 = z;
double r261641 = r261639 / r261640;
return r261641;
}
double f(double x, double y, double z) {
double r261642 = x;
double r261643 = y;
double r261644 = sin(r261643);
double r261645 = r261644 / r261643;
double r261646 = r261642 * r261645;
double r261647 = -1.371660816435321e-137;
bool r261648 = r261646 <= r261647;
double r261649 = 1.0;
double r261650 = r261649 / r261643;
double r261651 = r261644 * r261650;
double r261652 = r261642 * r261651;
double r261653 = z;
double r261654 = r261652 / r261653;
double r261655 = r261653 / r261645;
double r261656 = r261642 / r261655;
double r261657 = r261648 ? r261654 : r261656;
return r261657;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if (* x (/ (sin y) y)) < -1.371660816435321e-137Initial program 0.2
rmApplied div-inv0.3
if -1.371660816435321e-137 < (* x (/ (sin y) y)) Initial program 3.6
rmApplied associate-/l*2.2
rmApplied pow12.2
Final simplification1.7
herbie shell --seed 2019212 +o rules:numerics
(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))