\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le 8.643245776965942508676671190095322059719 \cdot 10^{-110}:\\
\;\;\;\;\frac{x}{\frac{z}{\sin y \cdot \frac{1}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r354105 = x;
double r354106 = y;
double r354107 = sin(r354106);
double r354108 = r354107 / r354106;
double r354109 = r354105 * r354108;
double r354110 = z;
double r354111 = r354109 / r354110;
return r354111;
}
double f(double x, double y, double z) {
double r354112 = z;
double r354113 = 8.643245776965943e-110;
bool r354114 = r354112 <= r354113;
double r354115 = x;
double r354116 = y;
double r354117 = sin(r354116);
double r354118 = 1.0;
double r354119 = r354118 / r354116;
double r354120 = r354117 * r354119;
double r354121 = r354112 / r354120;
double r354122 = r354115 / r354121;
double r354123 = r354115 / r354112;
double r354124 = r354117 / r354116;
double r354125 = r354123 * r354124;
double r354126 = r354114 ? r354122 : r354125;
return r354126;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if z < 8.643245776965943e-110Initial program 3.7
rmApplied associate-/l*2.1
rmApplied div-inv2.2
if 8.643245776965943e-110 < z Initial program 0.6
rmApplied associate-/l*3.9
rmApplied div-inv4.0
rmApplied *-un-lft-identity4.0
Applied *-un-lft-identity4.0
Applied times-frac4.0
Simplified4.0
Simplified0.7
Final simplification1.7
herbie shell --seed 2019209
(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))