Hello all,

Not too long ago I needed some mathematical functions that I couldn't really find implemented anywhere. I eventually stumbled on someone's implementation and was able to code it up with GMP. I was wondering, would there be any interest in including these functions in the official MPIR? The functions are the Lucas U and Lucas V sequences, defined with parameters p and q. Here are the prototypes:

int mpz_lucasu(mpz_t rop, long int p, long int q, mpz_t k)
int mpz_lucasumod(mpz_t rop, long int p, long int q, mpz_t k, mpz_t n)
int mpz_lucasv(mpz_t rop, long int p, long int q, mpz_t k)
int mpz_lucasvmod(mpz_t rop, long int p, long int q, mpz_t k, mpz_t n)

You can download the code at the sourceforge site:
http://sourceforge.net/projects/mpzlucas/files/

This source is licensed under the LGPL and includes a sample main() function that calculates a few terms of each of the new functions based on p and q passed in on the command line.

Along with these Lucas functions, I'd also like to propose that we add several new prp functions to the official MPIR library. Here are the prototypes for the new prp functions:

int mpz_prp(mpz_t n, mpz_t a) aka: Fermat pseudoprime
int mpz_euler_prp(mpz_t n, mpz_t a) aka: Solovay-Strassen pseudoprime
int mpz_sprp(mpz_t n, mpz_t a) aka: Miller-Rabin pseudoprime
int mpz_fibonacci_prp(mpz_t n, long int p, long int q)
int mpz_lucas_prp(mpz_t n, long int p, long int q)
int mpz_stronglucas_prp(mpz_t n, long int p, long int q)
int mpz_extrastronglucas_prp(mpz_t n, long int p)
int mpz_selfridge_prp(mpz_t n) aka: Lucas-Selfridge pseudoprime
int mpz_strongselfridge_prp(mpz_t n) aka: strong Lucas-Selfridge pseudoprime
int mpz_bpsw_prp(mpz_t n)
int mpz_strongbpsw_prp(mpz_t n)

Where each function can return one of:
#define PRP_ERROR -1
#define PRP_COMPOSITE 0
#define PRP_PRP 1
#define PRP_PRIME 2

You can download the code at the sourceforge site:
http://sourceforge.net/projects/mpzprp/files/

The source is licensed under the LGPL and includes a sample main() function that will print the result of each prp test for a list of 25 numbers, starting with one given on the command line.

Is there any formal procedure to ask for new functions to be included into MPIR? What does everyone think about adding these functions to MPIR?

-David C.

P.S. Just for full disclosure, I've proposed the same changes to the GMP list, but there doesn't seem to be much interest in including these functions there. I really am curious to hear what people think about adding these functions to MPIR. I'd really love to have these available in a math library like MPIR, especially since MPIR has the Win64 assembly speedups that GMP doesn't.

--
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to