\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.1728892342568057 \cdot 10^{-27}:\\
\;\;\;\;\frac{x \cdot \left(\frac{1}{y} \cdot \sin y\right)}{z}\\
\mathbf{elif}\;z \le 1.32101974044890363 \cdot 10^{187}:\\
\;\;\;\;\frac{1 \cdot x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 \cdot \frac{x}{\frac{y}{\sin y}}\right) \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r522400 = x;
double r522401 = y;
double r522402 = sin(r522401);
double r522403 = r522402 / r522401;
double r522404 = r522400 * r522403;
double r522405 = z;
double r522406 = r522404 / r522405;
return r522406;
}
double f(double x, double y, double z) {
double r522407 = z;
double r522408 = -1.1728892342568057e-27;
bool r522409 = r522407 <= r522408;
double r522410 = x;
double r522411 = 1.0;
double r522412 = y;
double r522413 = r522411 / r522412;
double r522414 = sin(r522412);
double r522415 = r522413 * r522414;
double r522416 = r522410 * r522415;
double r522417 = r522416 / r522407;
double r522418 = 1.3210197404489036e+187;
bool r522419 = r522407 <= r522418;
double r522420 = r522411 * r522410;
double r522421 = r522412 / r522414;
double r522422 = r522407 * r522421;
double r522423 = r522420 / r522422;
double r522424 = r522410 / r522421;
double r522425 = r522411 * r522424;
double r522426 = r522411 / r522407;
double r522427 = r522425 * r522426;
double r522428 = r522419 ? r522423 : r522427;
double r522429 = r522409 ? r522417 : r522428;
return r522429;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 3.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if z < -1.1728892342568057e-27Initial program 0.2
rmApplied clear-num0.3
rmApplied div-inv0.4
Applied add-cube-cbrt0.4
Applied times-frac0.3
Simplified0.3
Simplified0.3
if -1.1728892342568057e-27 < z < 1.3210197404489036e+187Initial program 4.8
rmApplied clear-num4.9
rmApplied *-un-lft-identity4.9
Applied associate-*l*4.9
Simplified4.8
rmApplied associate-*r/4.8
Applied associate-/l/1.1
if 1.3210197404489036e+187 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied *-un-lft-identity0.1
Applied associate-*l*0.1
Simplified0.1
rmApplied div-inv0.2
Final simplification0.8
herbie shell --seed 2020062 +o rules:numerics
(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))