\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.6091788831885175 \cdot 10^{198}:\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{elif}\;z \le 9.28239712100140934 \cdot 10^{-126}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r477552 = x;
double r477553 = y;
double r477554 = sin(r477553);
double r477555 = r477554 / r477553;
double r477556 = r477552 * r477555;
double r477557 = z;
double r477558 = r477556 / r477557;
return r477558;
}
double f(double x, double y, double z) {
double r477559 = z;
double r477560 = -6.609178883188517e+198;
bool r477561 = r477559 <= r477560;
double r477562 = x;
double r477563 = y;
double r477564 = sin(r477563);
double r477565 = 1.0;
double r477566 = r477565 / r477563;
double r477567 = r477564 * r477566;
double r477568 = r477562 * r477567;
double r477569 = r477568 / r477559;
double r477570 = 9.282397121001409e-126;
bool r477571 = r477559 <= r477570;
double r477572 = r477564 / r477563;
double r477573 = r477559 / r477572;
double r477574 = r477562 / r477573;
double r477575 = r477563 / r477564;
double r477576 = r477565 / r477575;
double r477577 = r477562 * r477576;
double r477578 = r477577 / r477559;
double r477579 = r477571 ? r477574 : r477578;
double r477580 = r477561 ? r477569 : r477579;
return r477580;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.2 |
| Herbie | 1.0 |
if z < -6.609178883188517e+198Initial program 0.1
rmApplied div-inv0.1
if -6.609178883188517e+198 < z < 9.282397121001409e-126Initial program 4.9
rmApplied associate-/l*1.3
if 9.282397121001409e-126 < z Initial program 0.8
rmApplied clear-num0.8
Final simplification1.0
herbie shell --seed 2020046 +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))