\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 r583124 = x;
double r583125 = y;
double r583126 = sin(r583125);
double r583127 = r583126 / r583125;
double r583128 = r583124 * r583127;
double r583129 = z;
double r583130 = r583128 / r583129;
return r583130;
}
double f(double x, double y, double z) {
double r583131 = z;
double r583132 = -9.486114843931962e-94;
bool r583133 = r583131 <= r583132;
double r583134 = 1.430539138784226e+127;
bool r583135 = r583131 <= r583134;
double r583136 = !r583135;
bool r583137 = r583133 || r583136;
double r583138 = x;
double r583139 = 1.0;
double r583140 = y;
double r583141 = sin(r583140);
double r583142 = r583140 / r583141;
double r583143 = r583139 / r583142;
double r583144 = r583138 * r583143;
double r583145 = r583144 / r583131;
double r583146 = r583141 / r583140;
double r583147 = r583146 / r583131;
double r583148 = r583138 * r583147;
double r583149 = r583137 ? r583145 : r583148;
return r583149;
}




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))