Lines Matching refs:HW
27 #define HW (typeWidth / 2)
29 #define loMask (REP_C(-1) >> HW)
120 // Let b_hw be an infinitely precise number obtained from the highest (HW-1)
122 // half_rep_t-sized b_UQ1_hw represented in UQ1.(HW-1) that is a **truncated**
129 // <= abs(e_n) + 2 * 2^-HW
139 const half_rep_t b_UQ1_hw = bSignificand >> (significandBits + 1 - HW);
141 // C is (3/4 + 1/sqrt(2)) - 1 truncated to W0 fractional bits as UQ0.HW
142 // with W0 being either 16 or 32 and W0 <= HW.
152 // HW is at least 32. Shifting into the highest bits if needed.
153 const half_rep_t C_hw = HALF_REP_C(0x7504F333) << (HW - 32);
157 // so x0 fits to UQ0.HW without wrapping.
158 half_rep_t x_UQ0_hw = C_hw - (b_UQ1_hw /* exact b_hw/2 as UQ0.HW */);
183 // "0.0 - (...)" is equivalent to "2.0 - (...)" in UQ1.(HW-1).
185 // no overflow occurred earlier: ((rep_t)x_UQ0_hw * b_UQ1_hw >> HW) is
188 half_rep_t corr_UQ1_hw = 0 - ((rep_t)x_UQ0_hw * b_UQ1_hw >> HW);
190 // Now, we should multiply UQ0.HW and UQ1.(HW-1) numbers, naturally
191 // obtaining an UQ1.(HW-1) number and proving its highest bit could be
192 // considered to be 0 to be able to represent it in UQ0.HW.
198 // to 1.0 being not representable as UQ0.HW).
202 x_UQ0_hw = (rep_t)x_UQ0_hw * corr_UQ1_hw >> (HW - 1);
208 // In infinite precision, with 0 <= eps1, eps2 <= U = 2^-HW:
219 // For initial half-width iterations, U = 2^-HW
227 // value representable in UQ0.HW or less by 1. This means that 1/b_hw have to
232 rep_t x_UQ0 = (rep_t)x_UQ0_hw << HW;
264 // x_UQ0 = x_UQ0_hw * 2^HW - 1
265 // x_UQ0 * b_UQ1 = (x_UQ0_hw * 2^HW) * (b_UQ1_hw * 2^HW + blo) - b_UQ1
273 + ((rep_t)x_UQ0_hw * blo >> HW)
276 rep_t hi_corr = corr_UQ1 >> HW;
277 // x_UQ0 * corr_UQ1 = (x_UQ0_hw * 2^HW) * (hi_corr * 2^HW + lo_corr) - corr_UQ1
279 + ((rep_t)x_UQ0_hw * lo_corr >> (HW - 1))
288 // abs(E_{N-1}) <= (u_{N-1} + 2 /* due to conversion e_n -> E_n */) * 2^-HW
289 // + (2^-HW + 2^-W))
290 // abs(E_{N-1}) <= (u_{N-1} + 3.01) * 2^-HW
296 // abs(E_N) <= 2^-W * [ 4 * (u_{N-1} + 3.01) * 2^-HW + max(4 + 2 * (u_{N-1} + 3.01)^2, 8) ]
304 // u_0 = (3/4 - 1/sqrt(2) + 2^-W0) * 2^HW