\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.36679473324426535 \cdot 10^{84}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\
\mathbf{elif}\;x \le 1.8458756307979711 \cdot 10^{111}:\\
\;\;\;\;x \cdot \frac{1}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot \sin y\right) \cdot \frac{1}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r686716 = x;
double r686717 = y;
double r686718 = sin(r686717);
double r686719 = r686718 / r686717;
double r686720 = r686716 * r686719;
double r686721 = z;
double r686722 = r686720 / r686721;
return r686722;
}
double f(double x, double y, double z) {
double r686723 = x;
double r686724 = -1.3667947332442653e+84;
bool r686725 = r686723 <= r686724;
double r686726 = 1.0;
double r686727 = z;
double r686728 = y;
double r686729 = sin(r686728);
double r686730 = r686729 / r686728;
double r686731 = r686723 * r686730;
double r686732 = r686727 / r686731;
double r686733 = r686726 / r686732;
double r686734 = 1.845875630797971e+111;
bool r686735 = r686723 <= r686734;
double r686736 = r686727 / r686730;
double r686737 = r686726 / r686736;
double r686738 = r686723 * r686737;
double r686739 = r686723 * r686729;
double r686740 = r686726 / r686728;
double r686741 = r686739 * r686740;
double r686742 = r686741 / r686727;
double r686743 = r686735 ? r686738 : r686742;
double r686744 = r686725 ? r686733 : r686743;
return r686744;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.7 |
if x < -1.3667947332442653e+84Initial program 0.2
rmApplied clear-num0.4
if -1.3667947332442653e+84 < x < 1.845875630797971e+111Initial program 3.6
rmApplied *-un-lft-identity3.6
Applied times-frac0.7
Simplified0.7
rmApplied *-un-lft-identity0.7
Applied *-un-lft-identity0.7
Applied times-frac0.7
Applied associate-/l*0.8
if 1.845875630797971e+111 < x Initial program 0.2
rmApplied div-inv0.3
Applied associate-*r*0.3
Final simplification0.7
herbie shell --seed 2020035
(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))