\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -1.371660816435320975638711159936380278311 \cdot 10^{-137}:\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r380624 = x;
double r380625 = y;
double r380626 = sin(r380625);
double r380627 = r380626 / r380625;
double r380628 = r380624 * r380627;
double r380629 = z;
double r380630 = r380628 / r380629;
return r380630;
}
double f(double x, double y, double z) {
double r380631 = x;
double r380632 = y;
double r380633 = sin(r380632);
double r380634 = r380633 / r380632;
double r380635 = r380631 * r380634;
double r380636 = -1.371660816435321e-137;
bool r380637 = r380635 <= r380636;
double r380638 = 1.0;
double r380639 = r380638 / r380632;
double r380640 = r380633 * r380639;
double r380641 = r380631 * r380640;
double r380642 = z;
double r380643 = r380641 / r380642;
double r380644 = r380642 / r380634;
double r380645 = r380631 / r380644;
double r380646 = r380637 ? r380643 : r380645;
return r380646;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if (* x (/ (sin y) y)) < -1.371660816435321e-137Initial program 0.2
rmApplied div-inv0.3
if -1.371660816435321e-137 < (* x (/ (sin y) y)) Initial program 3.6
rmApplied associate-/l*2.2
rmApplied pow12.2
Final simplification1.7
herbie shell --seed 2019212
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))