++ed by:
EMAZEP ZMUGHAL NGLENN AKRON DAVIDO

7 PAUSE users

Dana Jacobsen

Modules

Changes for version 0.32

  • ADDED
    • is_proven_prime
    • is_proven_prime_with_cert
    • carmichael_lambda
    • znorder
    • prime_iterator_object
    • miller_rabin_random
  • NEW FEATURES
    • Added Math::Prime::Util::PrimeIterator. A more feature-rich iterator than the simple closure one from prime_iterator. Experimental.
    • Make very simple LMO primecount work, and switch prime_count to use it. It is slower for large inputs, but uses much less memory. For smaller inputs it it as fast or faster. Lehmer code modified to constrain memory use at the expense of speed (starts taking effect at ~ 10^16). Thanks to Kim Walisch for discussions about this. Note that this is a very simple implementation -- better code could run 10x faster and use even less memory.
    • divisor_sum can take an integer 'k' in the second argument to compute sigma_k. This is much faster than using subs, especially when the result can be computed in XS using native precision. For integer second arguments, the result will automatically be a bigint if needed. It is also much faster for larger inputs.
    • factor() can be called in scalar context to give the number of prime factors. The XS function was ignoring the context, and now is more consistent. It also slightly speeds up looking at the number of factors, e.g. Omega(x) A001222.
  • FUNCTIONALITY AND PERFORMANCE
    • Use MPU::GMP::pn_primorial if we have it.
    • Input validation accepts bigint objects and converts them to scalars entirely in XS.
    • random_nbit_prime now uses Fouque and Tibouchi A1 for 65+ bits. Slightly better uniformity and typically a bit faster.
    • Incorporate Montgomery reduction for primality testing, thanks to Wojciech Izykowski. This is a 1.3 to 1.5x speedup for is_prob_prime, is_prime, and is_strong_pseudoprime for numbers > 2^32 on x86_64. This also help things like prime_iterator for values > 2^32.
    • Montgomery reduction used in Lucas and Frobenius tests. Up to 2x speedup for 33 to 64-bit inputs on x86_64/gcc platforms.
    • Some fixes around near maxint primes, forprimes, etc. Includes more workarounds for Math::BigInt::GMP's constructor sign bug.
    • Bytes::Random::Secure is loaded only when random prime functionality is used. Shaves a few milliseconds and bytes off of startup.
    • Speedups for Perl (no GMP) primality and random primes.
  • MISC
    • Primality functions moved to their own file primality.c.