The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 0.42 - 2017-02-27

  • ADDED
    • lambertw(x[,digits]) Lambert W function
    • random_prime(a,b) random prob prime in range [a,b]
    • random_nbit_prime(nbits) random prob prime of exactly nbits bits
    • random_ndigit_prime(ndigs) random prob prime of exactly ndigs digits
    • seed_csprng(bytes,data) supply a seed to the internal CSPRNG
    • is_csprng_well_seeded() returns 1 if the CSPRNG has a proper seed
    • is_semiprime(n) does n have exactly two prime factors
  • FIXES
    • is_power behaviour for 1 and -1.
    • is_nminus1_prime could assert on some inputs. Fix.
    • chinese([3,0],[2,3]) made GMP go belly up. Thanks to Trizen for finding.
    • divisors(1) in list context would segfault. Thanks to Trizen for finding.
  • PERFORMANCE
    • Adjust zeta algorithm crossover for large precision. Makes a huge difference for bern{frac/real} with values > 53000. Thanks to Trizen for pointing this out.
    • zeta works for all real values, returns undef for 1. It has issues below -10 or so that need to be dealt with in a later release.
    • is_primitive_root a bit faster with large inputs.
    • stirling about 40% faster. Thanks to Karim Belabas.
  • OTHER
    • The ISAAC CSPRNG has been added internally and all functions call it. While it is quite fast it is slower than GMP's Mersenne Twister.
    • On startup, we attempt to seed ISAAC with 256 bytes from /dev/urandom. Callers can call is_csprng_well_seeded() to check if this succeeded, and call as needed seed_csprng() to seed or reseed.

Modules

Utilities related to prime numbers and factoring, using GMP