Please find my paper on Mersenne Variant Numbers, Primality, Factorization of Mersenne Variants and also the Very Fast Divide and GCD paper on the following website: academia.edu and search for me: Allan Menezes. Perhaps you can incorporate some of these ideas in GMPLIB's open source code Thank you, Allan Menezes