\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.3341519654404754 \cdot 10^{-26} \lor \neg \left(z \le 20427325237287192\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r548244 = x;
double r548245 = y;
double r548246 = sin(r548245);
double r548247 = r548246 / r548245;
double r548248 = r548244 * r548247;
double r548249 = z;
double r548250 = r548248 / r548249;
return r548250;
}
double f(double x, double y, double z) {
double r548251 = z;
double r548252 = -3.3341519654404754e-26;
bool r548253 = r548251 <= r548252;
double r548254 = 2.042732523728719e+16;
bool r548255 = r548251 <= r548254;
double r548256 = !r548255;
bool r548257 = r548253 || r548256;
double r548258 = x;
double r548259 = y;
double r548260 = sin(r548259);
double r548261 = r548260 / r548259;
double r548262 = r548258 * r548261;
double r548263 = r548262 / r548251;
double r548264 = r548259 / r548260;
double r548265 = r548251 * r548264;
double r548266 = r548258 / r548265;
double r548267 = r548257 ? r548263 : r548266;
return r548267;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -3.3341519654404754e-26 or 2.042732523728719e+16 < z Initial program 0.1
if -3.3341519654404754e-26 < z < 2.042732523728719e+16Initial program 5.9
rmApplied clear-num6.0
rmApplied associate-/l*0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020036
(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))