The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Changes for version 0.61 - 2017-03-12

  • ADDED
    • is_semiprime(n) Returns 1 if n has exactly 2 prime factors
    • is_pillai(p) Returns 0 or v wherev v! % n == n-1 and n % v != 1
    • inverse_li(n) Integer inverse of Logarithmic Integral
  • FUNCTIONALITY AND PERFORMANCE
    • is_power(-1,k) now returns true for odd k.
    • RiemannZeta with GMP was not subtracting 1 from results > 9.
    • PP Bernoulli algorithm changed to Seidel from Brent-Harvey. 2x speedup. Math::BigNum is 10x faster, and our GMP code is 2000x faster.
    • LambertW changes in C and PP. Much better initial approximation, and switch iteration from Halley to Fritsch. 2 to 10x faster.
    • Try to use GMP LambertW for bignums if it is available.
    • Use Montgomery math in more places:
      • sqrtmod. 1.2-1.7x faster.
      • is_primitive_root. Up to 2x faster for some inputs.
      • p-1 factoring stage 1.
    • Tune AKS r/s selection above 32-bit.
    • primes.pl uses twin_primes function for ~3x speedup.
    • native chinese can handle some cases that used to overflow. Use Shell sort on moduli to prevent pathological-but-reasonable test case.
    • chinese directly to GMP
    • Switch to Bytes::Random::Secure::Tiny -- fewer dependencies.
    • PP nth_prime_approx has better MSE and uses inverse_li above 10^12.
    • All random prime functions will use GMP versions if possible and if a custom irand has not been configured. They are much faster than the PP versions at smaller bit sizes.
    • is_carmichael and is_pillai small speedups.

Modules

Utilities related to prime numbers, including fast sieves and factoring
Elliptic curve operations for affine points
Elliptic curve operations for projective points
An auto-free object for Math::Prime::Util
Pure Perl version of Math::Prime::Util
PP front end for Math::Prime::Util
Primality proofs and certificates
A tied array for primes
An object iterator for primes
Generate random primes
Generate random primes using MPU::GMP
Perl Big Float versions of Riemann Zeta and R functions
Number theory utilities