mpz_perfect_square_p()
mdeale39 at yahoo.com
mdeale39 at yahoo.com
Tue Aug 13 23:54:45 CEST 2024
Hi,
I'm curious about mpz_perfect_square_p(). It appears to currently be using 2^48 - 1 and I'd like to try 2^60 - 1 [since even the notes suggest there's at least another prime to be had higher up]. I found GMP_NUMB_BITS, for mpn_mod_34lsub1() [in gmp-6.3/mpn/generic/mod_34lsub1.c] ... but am unsure how to proceed. I thought (naively? 8) maybe one or two files ... and voila! run a test to see if any improvement. After 5 or 6 files were open and I don't have my mind wrapped around "limbs" -- simply a matter of time, right? -- I thought it prudent to at least ask. Has anybody tried this? or, would you be able to provide any tips? pitfalls to avoid? etc.
Backgound: "FenderBender" on MersenneForum.org had a post entitled "Determine Squares" a few years ago, where he used Bloom Filters to detect (and filter out) Quadratic non-residues modulo a small prime. My research seems to confirm his set of primes is optimal, even though I found many more prime-filters to use. I see that mpz_perfect_square_p() uses LUT's, and that it is pretty darn rapid as is. I've no expectation of improving anything, though wouldn't that be a revelation worth sharing.
TIA,
M.D.
More information about the gmp-discuss
mailing list