\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.07914030231644789 \cdot 10^{32} \lor \neg \left(z \le 9.91958923133224245 \cdot 10^{38}\right):\\
\;\;\;\;\left(x \cdot \left(1 \cdot \frac{\sin y}{y}\right)\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r518823 = x;
double r518824 = y;
double r518825 = sin(r518824);
double r518826 = r518825 / r518824;
double r518827 = r518823 * r518826;
double r518828 = z;
double r518829 = r518827 / r518828;
return r518829;
}
double f(double x, double y, double z) {
double r518830 = z;
double r518831 = -1.0791403023164479e+32;
bool r518832 = r518830 <= r518831;
double r518833 = 9.919589231332242e+38;
bool r518834 = r518830 <= r518833;
double r518835 = !r518834;
bool r518836 = r518832 || r518835;
double r518837 = x;
double r518838 = 1.0;
double r518839 = y;
double r518840 = sin(r518839);
double r518841 = r518840 / r518839;
double r518842 = r518838 * r518841;
double r518843 = r518837 * r518842;
double r518844 = r518838 / r518830;
double r518845 = r518843 * r518844;
double r518846 = r518839 / r518840;
double r518847 = r518830 * r518846;
double r518848 = r518837 / r518847;
double r518849 = r518836 ? r518845 : r518848;
return r518849;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if z < -1.0791403023164479e+32 or 9.919589231332242e+38 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied *-un-lft-identity0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Applied add-cube-cbrt0.1
Applied times-frac0.1
Simplified0.1
Simplified0.1
rmApplied div-inv0.2
if -1.0791403023164479e+32 < z < 9.919589231332242e+38Initial program 4.9
rmApplied clear-num4.9
rmApplied associate-/l*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020018
(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))