\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.48611484393196181 \cdot 10^{-94} \lor \neg \left(z \le 1.43053913878422607 \cdot 10^{127}\right):\\
\;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r598801 = x;
double r598802 = y;
double r598803 = sin(r598802);
double r598804 = r598803 / r598802;
double r598805 = r598801 * r598804;
double r598806 = z;
double r598807 = r598805 / r598806;
return r598807;
}
double f(double x, double y, double z) {
double r598808 = z;
double r598809 = -9.486114843931962e-94;
bool r598810 = r598808 <= r598809;
double r598811 = 1.430539138784226e+127;
bool r598812 = r598808 <= r598811;
double r598813 = !r598812;
bool r598814 = r598810 || r598813;
double r598815 = x;
double r598816 = 1.0;
double r598817 = y;
double r598818 = sin(r598817);
double r598819 = r598817 / r598818;
double r598820 = r598816 / r598819;
double r598821 = r598815 * r598820;
double r598822 = r598821 / r598808;
double r598823 = r598818 / r598817;
double r598824 = r598823 / r598808;
double r598825 = r598815 * r598824;
double r598826 = r598814 ? r598822 : r598825;
return r598826;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.7 |
if z < -9.486114843931962e-94 or 1.430539138784226e+127 < z Initial program 0.6
rmApplied clear-num0.6
if -9.486114843931962e-94 < z < 1.430539138784226e+127Initial program 5.2
rmApplied *-un-lft-identity5.2
Applied times-frac0.7
Simplified0.7
Final simplification0.7
herbie shell --seed 2020046
(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))