\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 r20571621 = x;
double r20571622 = y;
double r20571623 = sin(r20571622);
double r20571624 = r20571623 / r20571622;
double r20571625 = r20571621 * r20571624;
double r20571626 = z;
double r20571627 = r20571625 / r20571626;
return r20571627;
}
double f(double x, double y, double z) {
double r20571628 = z;
double r20571629 = -5.593196487055916e+24;
bool r20571630 = r20571628 <= r20571629;
double r20571631 = x;
double r20571632 = 1.0;
double r20571633 = y;
double r20571634 = r20571632 / r20571633;
double r20571635 = sin(r20571633);
double r20571636 = r20571632 / r20571635;
double r20571637 = r20571634 / r20571636;
double r20571638 = r20571631 * r20571637;
double r20571639 = r20571638 / r20571628;
double r20571640 = 0.001397275382843653;
bool r20571641 = r20571628 <= r20571640;
double r20571642 = r20571635 / r20571633;
double r20571643 = r20571628 / r20571642;
double r20571644 = r20571631 / r20571643;
double r20571645 = r20571641 ? r20571644 : r20571639;
double r20571646 = r20571630 ? r20571639 : r20571645;
return r20571646;
}




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))