\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.9358893171807734 \cdot 10^{55} \lor \neg \left(z \le 3.7079327528267037 \cdot 10^{92}\right):\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r1031103 = x;
double r1031104 = y;
double r1031105 = sin(r1031104);
double r1031106 = r1031105 / r1031104;
double r1031107 = r1031103 * r1031106;
double r1031108 = z;
double r1031109 = r1031107 / r1031108;
return r1031109;
}
double f(double x, double y, double z) {
double r1031110 = z;
double r1031111 = -6.935889317180773e+55;
bool r1031112 = r1031110 <= r1031111;
double r1031113 = 3.7079327528267037e+92;
bool r1031114 = r1031110 <= r1031113;
double r1031115 = !r1031114;
bool r1031116 = r1031112 || r1031115;
double r1031117 = x;
double r1031118 = y;
double r1031119 = sin(r1031118);
double r1031120 = r1031117 * r1031119;
double r1031121 = r1031120 / r1031118;
double r1031122 = r1031121 / r1031110;
double r1031123 = r1031119 / r1031118;
double r1031124 = r1031123 / r1031110;
double r1031125 = r1031117 * r1031124;
double r1031126 = r1031116 ? r1031122 : r1031125;
return r1031126;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
if z < -6.935889317180773e+55 or 3.7079327528267037e+92 < z Initial program 0.1
rmApplied associate-*r/1.6
if -6.935889317180773e+55 < z < 3.7079327528267037e+92Initial program 4.5
rmApplied *-un-lft-identity4.5
Applied times-frac0.6
Simplified0.6
Final simplification1.0
herbie shell --seed 2020065
(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))