\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.4086238538771711 \cdot 10^{84}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r580640 = x;
double r580641 = y;
double r580642 = sin(r580641);
double r580643 = r580642 / r580641;
double r580644 = r580640 * r580643;
double r580645 = z;
double r580646 = r580644 / r580645;
return r580646;
}
double f(double x, double y, double z) {
double r580647 = x;
double r580648 = -1.408623853877171e+84;
bool r580649 = r580647 <= r580648;
double r580650 = 1.0;
double r580651 = z;
double r580652 = y;
double r580653 = sin(r580652);
double r580654 = r580653 / r580652;
double r580655 = r580647 * r580654;
double r580656 = r580651 / r580655;
double r580657 = r580650 / r580656;
double r580658 = r580654 / r580651;
double r580659 = r580647 * r580658;
double r580660 = r580649 ? r580657 : r580659;
return r580660;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.2 |
| Herbie | 1.6 |
if x < -1.408623853877171e+84Initial program 0.2
rmApplied clear-num0.4
if -1.408623853877171e+84 < x Initial program 3.1
rmApplied *-un-lft-identity3.1
Applied times-frac1.9
Simplified1.9
Final simplification1.6
herbie shell --seed 2020035 +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))