Changes for version 0.62 - 2017-04-16
- API Changes
- The 'irand' config option is removed, as we now use our own CSPRNG. It can be seeded with csrand() or srand(). The latter is not exported.
- The 'primeinc' config option is deprecated and will go away soon.
- ADDED
- irand() Returns uniform random 32-bit integer
- irand64() Returns uniform random 64-bit integer
- drand([fmax]) Returns uniform random NV (floating point)
- urandomb(n) Returns uniform random integer less than 2^n
- urandomm(n) Returns uniform random integer in [0, n-1]
- random_bytes(nbytes) Return a string of CSPRNG bytes
- csrand(data) Seed the CSPRNG
- srand([UV]) Insecure seed for the CSPRNG (not exported)
- entropy_bytes(nbytes) Returns data from our entropy source
- :rand Exports srand, rand, irand, irand64
- nth_ramanujan_prime_upper(n) Upper limit of nth Ramanujan prime
- nth_ramanujan_prime_lower(n) Lower limit of nth Ramanujan prime
- nth_ramanujan_prime_approx(n) Approximate nth Ramanujan prime
- ramanujan_prime_count_upper(n) Upper limit of Ramanujan prime count
- ramanujan_prime_count_lower(n) Lower limit of Ramanujan prime count
- ramanujan_prime_count_approx(n) Approximate Ramanujan prime count
- FUNCTIONALITY AND PERFORMANCE
- vecsum is faster when returning a bigint from native inputs (we construct the 128-bit string in C, then call _to_bigint).
- Add a simple Legendre prime sum using uint128_t, which means only for modern 64-bit compilers. It allows reasonably fast prime sums for larger inputs, e.g. 10^12 in 10 seconds. Kim Walisch's primesum is much more sophisticated and over 100x faster.
- is_pillai about 10x faster for composites.
- Much faster Ramanujan prime count and nth prime. These also now use vastly less memory even with large inputs.
- small speed ups for cluster sieve.
- faster PP is_semiprime.
- Add prime option to forpart restrictions for all prime / non-prime.
- is_primitive_root needs two args, as documented.
- We do random seeding ourselves now, so remove dependency.
- Random primes functions moved to XS / GMP, 3-10x faster.
Modules
Utilities related to prime numbers, including fast sieves and factoring
Pure Perl ChaCha20 CSPRNG
Elliptic curve operations for affine points
Elliptic curve operations for projective points
Get a good random seed
Pure Perl ISAAC CSPRNG
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
Perl Big Float versions of Riemann Zeta and R functions
Number theory utilities
Examples
- examples/README
- examples/abundant.pl
- examples/csrand-gmp.pl
- examples/csrand.pl
- examples/fibprime-mce.pl
- examples/fibprime-serial.pl
- examples/fibprime-threads.pl
- examples/find_mr_bases.pl
- examples/inverse_totient.pl
- examples/ktuplet-threads.pl
- examples/ktuplet.pl
- examples/numseqs.pl
- examples/porter.pl
- examples/project_euler_010.pl
- examples/project_euler_021.pl
- examples/project_euler_037.pl
- examples/project_euler_047.pl
- examples/project_euler_049.pl
- examples/project_euler_069.pl
- examples/project_euler_070.pl
- examples/project_euler_072.pl
- examples/project_euler_095.pl
- examples/project_euler_131.pl
- examples/project_euler_142.pl
- examples/project_euler_193.pl
- examples/project_euler_211.pl
- examples/project_euler_214.pl
- examples/project_euler_342.pl
- examples/project_euler_357.pl
- examples/sophie_germain.pl
- examples/twin_primes.pl
- examples/verify-cert.pl
- examples/verify-gmp-ecpp-cert.pl
- examples/verify-primegaps.pl
- examples/verify-sage-ecpp-cert.pl