\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{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x}{\frac{y}{\sin y}}\right)}^{1} \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z) {
double r519105 = x;
double r519106 = y;
double r519107 = sin(r519106);
double r519108 = r519107 / r519106;
double r519109 = r519105 * r519108;
double r519110 = z;
double r519111 = r519109 / r519110;
return r519111;
}
double f(double x, double y, double z) {
double r519112 = z;
double r519113 = -1.1728892342568057e-27;
bool r519114 = r519112 <= r519113;
double r519115 = x;
double r519116 = 1.0;
double r519117 = y;
double r519118 = r519116 / r519117;
double r519119 = sin(r519117);
double r519120 = r519118 * r519119;
double r519121 = r519115 * r519120;
double r519122 = r519121 / r519112;
double r519123 = 1.3210197404489036e+187;
bool r519124 = r519112 <= r519123;
double r519125 = r519117 / r519119;
double r519126 = r519112 * r519125;
double r519127 = r519115 / r519126;
double r519128 = r519115 / r519125;
double r519129 = pow(r519128, r519116);
double r519130 = r519116 / r519112;
double r519131 = r519129 * r519130;
double r519132 = r519124 ? r519127 : r519131;
double r519133 = r519114 ? r519122 : r519132;
return r519133;
}




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 associate-/l*1.2
Simplified1.1
if 1.3210197404489036e+187 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
rmApplied div-inv0.2
Final simplification0.8
herbie shell --seed 2020062
(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))