GMP library (factorial, binomial, perfect power)

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Mon Apr 23 19:13:26 CEST 2012


Dear Lhoussain,

Il Lun, 23 Aprile 2012 10:36 am, Lhoussain Aitassou ha scritto:
> I would be interested to participate to the development of GMP library.
> These points would interest me :
>
>> Factorial

I rewrote the code for factorial (mpz_fac_ui) a couple of months ago

http://www.gmplib.org:8000/gmp/log/tip/mpz/fac_ui.c

Of course there can be even better implementations. Which algorithm would
you suggest?

Now, we also have the code for the 2-multi-factorial n!!= n(n-2) in the
library, we should probably add also a general multi-factorial function (I
have some C-code and a small LaTeX-note, if you are interested).

>> Binomial coefficients

Also the code for binomial (mpz_bin_uiui) is changing these days.

http://www.gmplib.org:8000/gmp/log/tip/mpz/bin_uiui.c

It can be the right time to experiment and/or to suggest!

Moreover the code for binomial(N,K) with very big N (mpz_bin_ui) needs a
complete rewrite, in my opinion. This has not started, yet.

>> Perfect power

The code for perfect power is a few years old.

http://www.gmplib.org:8000/gmp/log/tip/mpn/generic/perfpow.c

Do you have some ideas to rewrite it with some more efficient algorithm?

Best regards,
Marco

-- 
http://bodrato.it/software/combinatorics.html



More information about the gmp-devel mailing list