View Single Post
Old 2020-03-26, 17:56   #81
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·3·541 Posts
Default

Quote:
Originally Posted by RedGolpe View Post
SIQS seems to work for any number. Segfaults seem confined to composites for which NFS is invoked.
Code:
>> siqs(2^308+97)

starting SIQS on c93:
[...]
***factors found***

P6 = 785033
P41 = 21544259627996485962520784751544229716373

***co-factor***
C47 = 30833240972859993737296999866502074697103820917

ans = 24205111660647199463571475696199723205691503845935261

>>
I've traced this back into the msieve library. Seems msieve has the same problem yafu did w.r.t gmp-6.2.0. I don't have developer privileges for the msieve repository but making this change locally and then recompiling (first msieve, then yafu) should work (haven't tested yet - busy with other stuff and won't be able to for a little bit).

in include\gmp_xface.h replace this code (starting at line 50 in my version)
Code:
static INLINE void uint64_2gmp(uint64 src, mpz_t dest) {

#if GMP_LIMB_BITS == 64
	dest->_mp_d[0] = src;
	dest->_mp_size = (src ? 1 : 0);
#else
	/* mpz_import is terribly slow */
	mpz_set_ui(dest, (uint32)(src >> 32));
	mpz_mul_2exp(dest, dest, 32);
	mpz_add_ui(dest, dest, (uint32)src);
#endif
}

with this code:

Code:
static INLINE void uint64_2gmp(uint64 src, mpz_t dest) {
#if GMP_LIMB_BITS == 64
	mpz_set_ui(dest, src);
#else
	/* mpz_import is terribly slow */
	mpz_set_ui(dest, (uint32)(src >> 32));
	mpz_mul_2exp(dest, dest, 32);
	mpz_add_ui(dest, dest, (uint32)src);
#endif
}

Last fiddled with by bsquared on 2020-03-26 at 17:56 Reason: the whole function...
bsquared is offline   Reply With Quote