\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 2.843405087967007653899124626840383149923 \cdot 10^{134}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r337644 = x;
double r337645 = y;
double r337646 = sin(r337645);
double r337647 = r337646 / r337645;
double r337648 = r337644 * r337647;
double r337649 = z;
double r337650 = r337648 / r337649;
return r337650;
}
double f(double x, double y, double z) {
double r337651 = x;
double r337652 = 2.8434050879670077e+134;
bool r337653 = r337651 <= r337652;
double r337654 = z;
double r337655 = y;
double r337656 = sin(r337655);
double r337657 = r337655 / r337656;
double r337658 = r337654 * r337657;
double r337659 = r337651 / r337658;
double r337660 = r337651 * r337656;
double r337661 = r337660 / r337655;
double r337662 = r337661 / r337654;
double r337663 = r337653 ? r337659 : r337662;
return r337663;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if x < 2.8434050879670077e+134Initial program 3.0
rmApplied associate-/l*1.8
Simplified1.8
if 2.8434050879670077e+134 < x Initial program 0.3
rmApplied pow10.3
Applied pow10.3
Applied pow-prod-down0.3
Simplified0.3
Final simplification1.6
herbie shell --seed 2019323 +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))