\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -4.5545988867587666 \cdot 10^{-295}:\\
\;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\
\mathbf{elif}\;x \cdot \frac{\sin y}{y} \le 7.56936427636939772 \cdot 10^{-202}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r557659 = x;
double r557660 = y;
double r557661 = sin(r557660);
double r557662 = r557661 / r557660;
double r557663 = r557659 * r557662;
double r557664 = z;
double r557665 = r557663 / r557664;
return r557665;
}
double f(double x, double y, double z) {
double r557666 = x;
double r557667 = y;
double r557668 = sin(r557667);
double r557669 = r557668 / r557667;
double r557670 = r557666 * r557669;
double r557671 = -4.554598886758767e-295;
bool r557672 = r557670 <= r557671;
double r557673 = 1.0;
double r557674 = r557667 / r557668;
double r557675 = r557673 / r557674;
double r557676 = r557666 * r557675;
double r557677 = z;
double r557678 = r557676 / r557677;
double r557679 = 7.569364276369398e-202;
bool r557680 = r557670 <= r557679;
double r557681 = r557669 / r557677;
double r557682 = r557666 * r557681;
double r557683 = r557673 / r557667;
double r557684 = r557673 / r557668;
double r557685 = r557683 / r557684;
double r557686 = r557666 * r557685;
double r557687 = r557686 / r557677;
double r557688 = r557680 ? r557682 : r557687;
double r557689 = r557672 ? r557678 : r557688;
return r557689;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if (* x (/ (sin y) y)) < -4.554598886758767e-295Initial program 0.2
rmApplied clear-num0.2
if -4.554598886758767e-295 < (* x (/ (sin y) y)) < 7.569364276369398e-202Initial program 10.7
rmApplied *-un-lft-identity10.7
Applied times-frac0.3
Simplified0.3
if 7.569364276369398e-202 < (* x (/ (sin y) y)) Initial program 0.2
rmApplied clear-num0.2
rmApplied div-inv0.3
Applied associate-/r*0.2
Final simplification0.2
herbie shell --seed 2020021 +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))