\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.2889274271188022 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{\sin y} \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r12589828 = x;
double r12589829 = y;
double r12589830 = sin(r12589829);
double r12589831 = r12589830 / r12589829;
double r12589832 = r12589828 * r12589831;
double r12589833 = z;
double r12589834 = r12589832 / r12589833;
return r12589834;
}
double f(double x, double y, double z) {
double r12589835 = x;
double r12589836 = -1.2889274271188022e+17;
bool r12589837 = r12589835 <= r12589836;
double r12589838 = y;
double r12589839 = sin(r12589838);
double r12589840 = r12589839 * r12589835;
double r12589841 = r12589840 / r12589838;
double r12589842 = z;
double r12589843 = r12589841 / r12589842;
double r12589844 = r12589838 / r12589839;
double r12589845 = r12589844 * r12589842;
double r12589846 = r12589835 / r12589845;
double r12589847 = r12589837 ? r12589843 : r12589846;
return r12589847;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.2 |
| Herbie | 1.4 |
if x < -1.2889274271188022e+17Initial program 0.2
rmApplied associate-*r/0.3
if -1.2889274271188022e+17 < x Initial program 3.5
rmApplied associate-/l*1.7
rmApplied *-un-lft-identity1.7
Applied *-un-lft-identity1.7
Applied times-frac1.7
Simplified1.7
rmApplied div-inv1.7
Simplified1.6
Final simplification1.4
herbie shell --seed 2019158
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
: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))