\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.558037767913342817643933364747126420158 \cdot 10^{92} \lor \neg \left(z \le 5.039220706859192027751049543236769960828 \cdot 10^{68}\right):\\
\;\;\;\;\frac{x}{\frac{y}{\sin y}} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r1642774 = x;
double r1642775 = y;
double r1642776 = sin(r1642775);
double r1642777 = r1642776 / r1642775;
double r1642778 = r1642774 * r1642777;
double r1642779 = z;
double r1642780 = r1642778 / r1642779;
return r1642780;
}
double f(double x, double y, double z) {
double r1642781 = z;
double r1642782 = -1.5580377679133428e+92;
bool r1642783 = r1642781 <= r1642782;
double r1642784 = 5.039220706859192e+68;
bool r1642785 = r1642781 <= r1642784;
double r1642786 = !r1642785;
bool r1642787 = r1642783 || r1642786;
double r1642788 = x;
double r1642789 = y;
double r1642790 = sin(r1642789);
double r1642791 = r1642789 / r1642790;
double r1642792 = r1642788 / r1642791;
double r1642793 = 1.0;
double r1642794 = r1642793 / r1642781;
double r1642795 = r1642792 * r1642794;
double r1642796 = r1642790 / r1642789;
double r1642797 = r1642781 / r1642796;
double r1642798 = r1642788 / r1642797;
double r1642799 = r1642787 ? r1642795 : r1642798;
return r1642799;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if z < -1.5580377679133428e+92 or 5.039220706859192e+68 < z Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied times-frac6.0
Simplified6.0
rmApplied clear-num6.0
rmApplied div-inv6.0
Applied associate-*r*0.2
Simplified0.2
if -1.5580377679133428e+92 < z < 5.039220706859192e+68Initial program 4.5
rmApplied associate-/l*0.6
Final simplification0.5
herbie shell --seed 2019235
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))