Lines Matching refs:nm1
1129 uintmax_t nm1 = n - one; /* -1, but in redc representation. */ in millerrabin() local
1131 if (y == one || y == nm1) in millerrabin()
1138 if (y == nm1) in millerrabin()
1177 mp_millerrabin (mpz_srcptr n, mpz_srcptr nm1, mpz_ptr x, mpz_ptr y, in mp_millerrabin() argument
1182 if (mpz_cmp_ui (y, 1) == 0 || mpz_cmp (y, nm1) == 0) in mp_millerrabin()
1188 if (mpz_cmp (y, nm1) == 0) in mp_millerrabin()
1282 uintmax_t q[2], nm1[2]; in prime2_p() local
1293 nm1[1] = n1 - (n0 == 0); in prime2_p()
1294 nm1[0] = n0 - 1; in prime2_p()
1295 if (nm1[0] == 0) in prime2_p()
1297 count_trailing_zeros (k, nm1[1]); in prime2_p()
1299 q[0] = nm1[1] >> k; in prime2_p()
1305 count_trailing_zeros (k, nm1[0]); in prime2_p()
1306 rsh2 (q[1], q[0], nm1[1], nm1[0], k); in prime2_p()
1324 factor (nm1[1], nm1[0], &factors); in prime2_p()
1341 e[0] = pi * nm1[0]; in prime2_p()
1352 rsh2 (e[1], e[0], nm1[1], nm1[0], 1); in prime2_p()
1354 divexact_21 (e[1], e[0], nm1[1], nm1[0], factors.p[i]); 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()
1395 mpz_sub_ui (nm1, n, 1); in mp_prime_p()
1398 mp_bitcnt_t k = mpz_scan1 (nm1, 0); 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()
1413 mpz_set (tmp, nm1); in mp_prime_p()
1426 mpz_divexact (tmp, nm1, factors.p[i]); 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()