\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -9.3033804533966324 \cdot 10^{-7} \lor \neg \left(x \le 7.1451913129313926 \cdot 10^{69}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r562164 = x;
double r562165 = y;
double r562166 = sin(r562165);
double r562167 = r562166 / r562165;
double r562168 = r562164 * r562167;
double r562169 = z;
double r562170 = r562168 / r562169;
return r562170;
}
double f(double x, double y, double z) {
double r562171 = x;
double r562172 = -9.303380453396632e-07;
bool r562173 = r562171 <= r562172;
double r562174 = 7.145191312931393e+69;
bool r562175 = r562171 <= r562174;
double r562176 = !r562175;
bool r562177 = r562173 || r562176;
double r562178 = y;
double r562179 = sin(r562178);
double r562180 = r562179 / r562178;
double r562181 = r562171 * r562180;
double r562182 = z;
double r562183 = r562181 / r562182;
double r562184 = r562171 / r562182;
double r562185 = r562178 / r562179;
double r562186 = r562184 / r562185;
double r562187 = r562177 ? r562183 : r562186;
return r562187;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -9.303380453396632e-07 or 7.145191312931393e+69 < x Initial program 0.2
if -9.303380453396632e-07 < x < 7.145191312931393e+69Initial program 4.3
rmApplied associate-/l*0.3
Simplified0.3
rmApplied associate-/r*0.3
Final simplification0.3
herbie shell --seed 2020047
(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))