INTEGER FUNCTION DFFTOPT( LEN) INTEGER LEN INTEGER*8 FUNCTION DFFTOPT_64( LEN) INTEGER*8 LEN
INTEGER FUNCTION DFFTOPT( LEN) INTEGER :: LEN INTEGER(8) FUNCTION DFFTOPT_64( LEN) INTEGER(8) :: LEN
int dfftopt(int len);
long dfftopt_64(long len);
DFFTOPT will return an integer no smaller than the input argument N that is the closest number that is the product of small primes. DFFTOPT will return 16 for an input of N=16 and return 18=2*3*3 for an input of N=17.
Note that the length computed here is not guaranteed to be optimal, only to be a product of small primes. Also, the value returned may change as the underlying FFTs become capable of handling larger primes. For example, passing in N=51 to day will return 52=2*2*13 rather than 51=3*17 because the FFTs in Performance Li brary do not have fast radix 17 code. In the future, radix 17 code may be added and then N=51 will return 51.