Another question. The code which determines if a BSW pseudoprimality
test is sufficient or not to absolutely guarantee primality is:
int
BSW_isprime_small(GEN x)
{
long l = lgefint(x);
if (l < 4) return 1;
if (l == 4)
{
pari_sp av = avma;
long t = cmpii(x, u2toi(0x918UL, 0x4e72a000UL)); /* 10^13 */
avma = av;
if (t < 0) return 1;
}
return 0;
}
But on a 64 bit machine, I'm pretty sure this always returns 1. It
looks like it was written for a 32 bit machine. That should be
checking if l == 3 on a 64 bit machine then checking if x < 10^13.
The first limb of a gen stores the type, the second the number of
limbs and some other bits of info and the third limb is the first limb
of actual data for an int.
I'm pretty sure that is a bug. So pari is not correctly certifying
single limb integers prime. No wonder it is so damned fast at
certifying primality.
Is that a typo for 2?
I would talk to Karim now, not wait until you have sorted everything out.
John