\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.8568993598992816 \cdot 10^{48} \lor \neg \left(z \le 1.34045888132617558 \cdot 10^{-169}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r1208794 = x;
double r1208795 = y;
double r1208796 = sin(r1208795);
double r1208797 = r1208796 / r1208795;
double r1208798 = r1208794 * r1208797;
double r1208799 = z;
double r1208800 = r1208798 / r1208799;
return r1208800;
}
double f(double x, double y, double z) {
double r1208801 = z;
double r1208802 = -2.8568993598992816e+48;
bool r1208803 = r1208801 <= r1208802;
double r1208804 = 1.3404588813261756e-169;
bool r1208805 = r1208801 <= r1208804;
double r1208806 = !r1208805;
bool r1208807 = r1208803 || r1208806;
double r1208808 = x;
double r1208809 = r1208808 / r1208801;
double r1208810 = 1.0;
double r1208811 = y;
double r1208812 = sin(r1208811);
double r1208813 = r1208812 / r1208811;
double r1208814 = r1208810 / r1208813;
double r1208815 = r1208809 / r1208814;
double r1208816 = r1208812 / r1208801;
double r1208817 = r1208816 / r1208811;
double r1208818 = r1208808 * r1208817;
double r1208819 = r1208807 ? r1208815 : r1208818;
return r1208819;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
if z < -2.8568993598992816e+48 or 1.3404588813261756e-169 < z Initial program 0.8
rmApplied associate-/l*4.3
rmApplied div-inv4.3
Applied associate-/r*1.1
if -2.8568993598992816e+48 < z < 1.3404588813261756e-169Initial program 6.0
rmApplied associate-/l*0.4
rmApplied div-inv0.5
Simplified0.7
Final simplification1.0
herbie shell --seed 2020034 +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))