fac_ui rewrote.
Torbjorn Granlund
tg at gmplib.org
Sat Dec 10 21:19:27 CET 2011
nisse at lysator.liu.se (Niels Möller) writes:
> mpz_bc_oddfac_1(x,n), likewise computes n! with every even factor removed;
> mpz_dsc_oddfac_1(x,n), computes the odd part of n!, asymptotically fast.
If you are using such building blocks, maybe it would make sense to
export a function for the "semi-factorial"? In my calculus course it was
denoted n!! = n (n-2) (n-4) ... (the product stopping at 1 for odd n and
2 for even n).
I don't remember off the top of my head in which context it was used,
but it must have appeared in some expansion of some not very exotic
function.
There are a bunch of similar functions, we should eprhaps consider the
most common ones.
Aside from double factorial (Swedish semifakultet) we could supply
either of the two common primorial definitions. (One is: product of the
first n primes, the other is: product of all primes below n.)
--
Torbjörn
More information about the gmp-devel
mailing list