Lines Matching refs:q
287 # define udiv_qrnnd(q, r, n1, n0, d) \ argument
306 (q) = __q; \
808 q = t0 * pd[I].binv; \ in factor_using_division()
809 if (LIKELY (q > pd[I].lim)) \ in factor_using_division()
811 t0 = q; \ in factor_using_division()
818 uintmax_t q; in factor_using_division() local
840 mpz_t q; in mp_factor_using_division() local
845 mpz_init (q); in mp_factor_using_division()
871 mpz_clear (q); in mp_factor_using_division()
975 uintmax_t rh, rl, q, th, xh; in mulredc() local
979 q = rl * mi; in mulredc()
980 umul_ppmm (th, tl, q, m); in mulredc()
996 uintmax_t r1, r0, q, p1, t1, t0, s1, s0; in mulredc2() local
1018 q = mi * t0; in mulredc2()
1019 umul_ppmm (p1, p0, q, m0); in mulredc2()
1020 umul_ppmm (s1, s0, q, m1); in mulredc2()
1044 q = mi * t0; in mulredc2()
1046 umul_ppmm (p1, p0, q, m0); in mulredc2()
1047 umul_ppmm (s1, s0, q, m1); in mulredc2()
1124 millerrabin (uintmax_t n, uintmax_t ni, uintmax_t b, uintmax_t q, in millerrabin() argument
1127 uintmax_t y = powm (b, q, n, ni, one); in millerrabin()
1178 mpz_srcptr q, mp_bitcnt_t k) in mp_millerrabin() argument
1180 mpz_powm (y, x, q, n); in mp_millerrabin()
1214 uintmax_t q = n - 1; in prime_p() local
1215 for (k = 0; (q & 1) == 0; k++) in prime_p()
1216 q >>= 1; in prime_p()
1224 if (!millerrabin (n, ni, a_prim, q, k, one)) in prime_p()
1272 if (!millerrabin (n, ni, a_prim, q, k, one)) in prime_p()
1282 uintmax_t q[2], nm1[2]; in prime2_p() local
1299 q[0] = nm1[1] >> k; in prime2_p()
1300 q[1] = 0; in prime2_p()
1306 rsh2 (q[1], q[0], nm1[1], nm1[0], k); in prime2_p()
1318 if (!millerrabin2 (na, ni, a_prim, q, k, one)) in prime2_p()
1371 if (!millerrabin2 (na, ni, a_prim, q, k, one)) in prime2_p()
1382 mpz_t q, a, nm1, tmp; in mp_prime_p() local
1392 mpz_inits (q, a, nm1, tmp, nullptr); in mp_prime_p()
1399 mpz_tdiv_q_2exp (q, nm1, k); in mp_prime_p()
1404 if (!mp_millerrabin (n, nm1, a, tmp, q, k)) in mp_prime_p()
1442 if (!mp_millerrabin (n, nm1, a, tmp, q, k)) in mp_prime_p()
1455 mpz_clears (q, a, nm1, tmp, nullptr); in mp_prime_p()
1813 uintmax_t q, y; in isqrt2() local
1814 udiv_qrnnd (q, r, nh, nl, x); in isqrt2()
1815 y = (x + q) / 2; in isqrt2()
1885 # define div_smallq(q, r, u, d) \ argument
1907 (q) = _q - _mask; \
1908 affirm ((q) * (d) + (r) == u); \
1914 (q) = _q; \
2075 uintmax_t q, P1, t, rem; in factor_using_squfof() local
2077 div_smallq (q, rem, S + P, Q); in factor_using_squfof()
2080 affirm (q > 0 && Q > 0); in factor_using_squfof()
2084 q_freq[MIN (q, Q_FREQ_SIZE)]++; in factor_using_squfof()
2108 t = Q1 + q * (P - P1); in factor_using_squfof()
2166 div_smallq (q, rem, S + P, Q); in factor_using_squfof()
2171 q_freq[MIN (q, Q_FREQ_SIZE)]++; in factor_using_squfof()
2175 t = Q1 + q * (P - P1); in factor_using_squfof()
2429 uintmax_t q, r; in print_uintmaxes() local
2437 q = t1 / 1000000000; in print_uintmaxes()
2440 print_uintmaxes (q, t0); in print_uintmaxes()