\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le 4.04058555517106442439703059130784734804 \cdot 10^{60}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r301210 = x;
double r301211 = y;
double r301212 = sin(r301211);
double r301213 = r301212 / r301211;
double r301214 = r301210 * r301213;
double r301215 = z;
double r301216 = r301214 / r301215;
return r301216;
}
double f(double x, double y, double z) {
double r301217 = z;
double r301218 = 4.0405855551710644e+60;
bool r301219 = r301217 <= r301218;
double r301220 = x;
double r301221 = y;
double r301222 = sin(r301221);
double r301223 = r301222 / r301221;
double r301224 = r301223 / r301217;
double r301225 = r301220 * r301224;
double r301226 = r301221 / r301222;
double r301227 = r301220 / r301226;
double r301228 = r301227 / r301217;
double r301229 = r301219 ? r301225 : r301228;
return r301229;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if z < 4.0405855551710644e+60Initial program 3.6
Simplified2.0
if 4.0405855551710644e+60 < z Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied associate-/r*0.1
Simplified0.1
Final simplification1.6
herbie shell --seed 2019195
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))