Home | History | Annotate | Download | only in lib

Lines Matching refs:reciprocal

79     // [1, 2.0) and get a Q32 approximate reciprocal using a small minimax
80 // polynomial approximation: reciprocal = 3/4 + 1/sqrt(2) - b/2. This
83 uint32_t reciprocal = UINT32_C(0x7504f333) - q31b;
85 // Now refine the reciprocal estimate using a Newton-Raphson iteration:
93 correction = -((uint64_t)reciprocal * q31b >> 32);
94 reciprocal = (uint64_t)reciprocal * correction >> 31;
95 correction = -((uint64_t)reciprocal * q31b >> 32);
96 reciprocal = (uint64_t)reciprocal * correction >> 31;
97 correction = -((uint64_t)reciprocal * q31b >> 32);
98 reciprocal = (uint64_t)reciprocal * correction >> 31;
100 // Exhaustive testing shows that the error in reciprocal after three steps
102 // expectations. We bump the reciprocal by a tiny value to force the error
106 reciprocal -= 2;
108 // The numerical reciprocal is accurate to within 2^-28, lies in the
110 // than the true reciprocal of b. Multiplying a by this reciprocal thus
117 // is the error in the reciprocal of b scaled by the maximum
120 rep_t quotient = (uint64_t)reciprocal*(aSignificand << 1) >> 32;