\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le 2.038405760172519767516186916830460470804 \cdot 10^{-223}:\\
\;\;\;\;\frac{\sin y}{y} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\end{array}double f(double x, double y, double z) {
double r557159 = x;
double r557160 = y;
double r557161 = sin(r557160);
double r557162 = r557161 / r557160;
double r557163 = r557159 * r557162;
double r557164 = z;
double r557165 = r557163 / r557164;
return r557165;
}
double f(double x, double y, double z) {
double r557166 = z;
double r557167 = 2.0384057601725198e-223;
bool r557168 = r557166 <= r557167;
double r557169 = y;
double r557170 = sin(r557169);
double r557171 = r557170 / r557169;
double r557172 = x;
double r557173 = r557172 / r557166;
double r557174 = r557171 * r557173;
double r557175 = 1.0;
double r557176 = r557175 / r557169;
double r557177 = r557170 * r557176;
double r557178 = r557172 * r557177;
double r557179 = r557178 / r557166;
double r557180 = r557168 ? r557174 : r557179;
return r557180;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 3.2 |
if z < 2.0384057601725198e-223Initial program 3.5
rmApplied div-inv3.6
rmApplied clear-num4.0
Simplified3.9
rmApplied *-un-lft-identity3.9
Applied times-frac4.2
Applied add-cube-cbrt4.2
Applied times-frac4.3
Simplified4.3
Simplified4.0
if 2.0384057601725198e-223 < z Initial program 2.1
rmApplied div-inv2.1
Final simplification3.2
herbie shell --seed 2019350
(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))