\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -5.83744516104687908 \cdot 10^{-226} \lor \neg \left(x \le 2.8660794228489788 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sqrt[3]{1}}{\frac{y}{\sin y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{\frac{y}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r422068 = x;
double r422069 = y;
double r422070 = sin(r422069);
double r422071 = r422070 / r422069;
double r422072 = r422068 * r422071;
double r422073 = z;
double r422074 = r422072 / r422073;
return r422074;
}
double f(double x, double y, double z) {
double r422075 = x;
double r422076 = -5.837445161046879e-226;
bool r422077 = r422075 <= r422076;
double r422078 = 2.866079422848979e-87;
bool r422079 = r422075 <= r422078;
double r422080 = !r422079;
bool r422081 = r422077 || r422080;
double r422082 = 1.0;
double r422083 = cbrt(r422082);
double r422084 = y;
double r422085 = sin(r422084);
double r422086 = r422084 / r422085;
double r422087 = r422083 / r422086;
double r422088 = r422075 * r422087;
double r422089 = z;
double r422090 = r422088 / r422089;
double r422091 = r422082 / r422086;
double r422092 = r422091 / r422089;
double r422093 = r422075 * r422092;
double r422094 = r422081 ? r422090 : r422093;
return r422094;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.3 |
| Herbie | 1.2 |
if x < -5.837445161046879e-226 or 2.866079422848979e-87 < x Initial program 1.5
rmApplied clear-num1.6
rmApplied *-un-lft-identity1.6
Applied *-un-lft-identity1.6
Applied times-frac1.6
Applied add-cube-cbrt1.6
Applied times-frac1.6
Applied associate-*r*1.6
Simplified1.6
if -5.837445161046879e-226 < x < 2.866079422848979e-87Initial program 6.7
rmApplied *-un-lft-identity6.7
Applied times-frac0.2
Simplified0.2
rmApplied clear-num0.2
Final simplification1.2
herbie shell --seed 2020045
(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))