Unused code in mpn_mul_fft_decompose?

paul zimmermann Paul.Zimmermann at inria.fr
Tue Mar 5 09:53:39 UTC 2019

       Dear Mikhail,

> From: Mikhail Hogrefe <mikhailhogrefe at gmail.com>
> Date: Mon, 4 Mar 2019 21:44:50 -0500
> I was digging around in the GMP 6.1.2 source, and I noticed something in
> mpn/generic/mul_fft.c.
> In mpn_mul_fft_decompose, there is an if statement checking 'dif > Kl',
> which is equivalent to 'nl > 2 * K * l'. But there is a comment above the
> function saying 'We must have nl <= 2*K*l.', suggesting that the first
> branch of the if is never taken.
> Maybe you're already aware of this, but if not I wanted to let you know.
> Best,
> Mikhail Hogrefe

good remark. Indeed in the mul_fft.c file, it seems this code is dead.
However if mpn_mul_fft_decompose is exported, for example if one wants to
compute a product of two numbers modulo 2^n+1, where the two numbers have
more than 2n bits, then this branch might be useful.

Anyway this code is now obsolete (see [1] and [2]).

Best regards,
Paul Zimmermann

[1] http://homepages.loria.fr/PZimmermann/papers/#fft

[2] https://gmplib.org/devel/ "This will largely depend on ongoing work on FFT

More information about the gmp-devel mailing list