bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Factorial and Radix Conversion improvements


From: Kevin Ryde
Subject: Re: Factorial and Radix Conversion improvements
Date: 11 Nov 2001 06:55:16 +1000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.5

Joshua Liu <address@hidden> writes:
>
> The following code implements a binary splitting
> method to finding a
> pochhammer (and the factorial as a specific case).  It
> balances the
> multiplications more effectively than mpz/fac_ui.c

Sorry, it's not obvious that it does so.  It looks like it takes the
terms in a different order, but not much more than that.

But for what it's worth, there's certainly improvements possible in
mpz_fac_ui.  For a start factors of two should be counted up and
applied at the end.  Currently they bloat the multiplies with low zero
bits.

It might even be useful to calculate what power of each prime should
go into the final product.  They could then be powered up (all
together), which makes it possible to do some squaring instead of
multiplying, which is of course faster.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]