\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5593196487055916383862784:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\mathbf{elif}\;z \le 0.001397275382843652952874480277500879310537:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\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 r19723653 = x;
double r19723654 = y;
double r19723655 = sin(r19723654);
double r19723656 = r19723655 / r19723654;
double r19723657 = r19723653 * r19723656;
double r19723658 = z;
double r19723659 = r19723657 / r19723658;
return r19723659;
}
double f(double x, double y, double z) {
double r19723660 = z;
double r19723661 = -5.593196487055916e+24;
bool r19723662 = r19723660 <= r19723661;
double r19723663 = x;
double r19723664 = 1.0;
double r19723665 = y;
double r19723666 = r19723664 / r19723665;
double r19723667 = sin(r19723665);
double r19723668 = r19723664 / r19723667;
double r19723669 = r19723666 / r19723668;
double r19723670 = r19723663 * r19723669;
double r19723671 = r19723670 / r19723660;
double r19723672 = 0.001397275382843653;
bool r19723673 = r19723660 <= r19723672;
double r19723674 = r19723667 / r19723665;
double r19723675 = r19723660 / r19723674;
double r19723676 = r19723663 / r19723675;
double r19723677 = r19723673 ? r19723676 : r19723671;
double r19723678 = r19723662 ? r19723671 : r19723677;
return r19723678;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -5.593196487055916e+24 or 0.001397275382843653 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied div-inv0.2
Applied associate-/r*0.2
if -5.593196487055916e+24 < z < 0.001397275382843653Initial program 5.7
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))