Changes for version 0.23
- Replace XS Zeta for x > 5 with series from Cephes. It is 1 eps more accurate for a small fraction of inputs. More importantly, it is much faster in range 5 < x < 10. This only affects non-integer inputs.
- PP Zeta code replaced (for no-MPFR, non-bignums) with new series. The new code is much more accurate for small values, and *much* faster.
- Add consecutive_integer_lcm function, just like MPU::GMP's (though we define ci_lcm(0) = 0, which should get propogated).
- Implement binary search on RiemannR for XS nth_prime when n > 2e11. Runs ~2x faster for 1e12, 3x faster for 1e13. Thanks to Programming Praxis for the idea and motivation.
- Add the first and second Chebyshev functions (theta and psi).
- put isqrt(n) in util.h, use it everywhere. put icbrt(n) in lehmer.h, use it there.
- Start on Lagarias-Miller-Odlyzko prime count.
- A new data structure for the phi(x,a) function used by all the fast prime count routines. Quite a bit faster and most importantly, uses half the memory of the old structure.
- Performance:
- Divisor sum with no sub is ~10x faster.
- Speed up PP version of exp_mangoldt, create XS version.
- Zeta much faster as mentioned above.
- faster nth_prime as mentioned above.
- AKS about 10% faster.
- Unroll a little more in sieve inner loop. A couple percent faster.
- Faster prime_count and nth_prime due to new phi(x,a) (about 1.25x).
Modules
Utilities related to prime numbers, including fast sieves and factoring
An auto-free object for Math::Prime::Util
Pure Perl version of Math::Prime::Util
A tied array for primes
Perl Big Float versions of Riemann Zeta and R functions
Examples
- examples/README
- examples/bench-factor-extra.pl
- examples/bench-factor-semiprime.pl
- examples/bench-factor.pl
- examples/bench-is-prime.pl
- examples/bench-isprime-bpsw.pl
- examples/bench-miller-rabin.pl
- examples/bench-mp-nextprime.pl
- examples/bench-mp-prime_count.pl
- examples/bench-mp-psrp.pl
- examples/bench-nthprime.pl
- examples/bench-pcapprox.pl
- examples/bench-pp-count.pl
- examples/bench-pp-isprime.pl
- examples/bench-pp-sieve.pl
- examples/bench-primecount.pl
- examples/bench-random-prime-bigint.pl
- examples/bench-random-prime.pl
- examples/find_mr_bases.pl
- examples/parallel_fibprime.pl
- examples/sophie_germain.pl
- examples/test-bpsw.pl
- examples/test-euler-pari.pl
- examples/test-factor-gnufactor.pl
- examples/test-factor-mpxs.pl
- examples/test-factor-yafu.pl
- examples/test-nextprime-yafu.pl
- examples/test-nthapprox.pl
- examples/test-pcapprox.pl
- examples/test-primes-script.pl
- examples/test-primes-script2.pl
- examples/test-primes-yafu.pl
- examples/twin_primes.pl