Dear Allan, Algorithm 1 page 4 computes one bit at a time. I doubt it can outperform the GMP routine, which computes 64 bits at a time (on a 64-bit computer). Please make your code available so that people can confirm your claims. Best regards, Paul Zimmermann