The program calcbn uses the apfloat library. For optimization you can adjust the file apfloat.ini which must be in the same folder as calcbn. For more documentation of apfloat please visit www.apfloat.org. 5. Adjusting System Parameters The file apfloat.ini (must be in the current directory) can contain some (optional) information about your system. It's highly recommended that you check the values especially if you plan to do very long calculations. It can have the following lines: Ramsize=41943040 This is your computer's memory size in bytes. An estimate of the program and operating system code size is subtracted from this value to get the maximum available power-of-two or three times a power of two block size. CacheL1size=8192 The processor's level-1 cache size in bytes. This has no great effect on the performance, so if you don't know it, you should probably leave it to 8192. CacheL2size=262144 The processor's level-2 cache size in bytes. This has no great effect on the performance, so you should probably leave it alone unless you are an optimization freak. Cacheburst=32 The cache's burst size (or a cache line size) in bytes, typically set to 32 or 16. Again this has no big effect. The cache parameters are only used in matrix transposition in the transform algorithms (see appendix D), which takes only a very small part of the total program CPU time. Memorytreshold=131072 Longer data blocks than this are stored on disk by default. When the numbers are stored in memory, the program runs slightly faster. Don't set it to too high or the program will swap or run out of memory. Blocksize=65536 Efficient disk I/O block size (in modints), should be <= Memorytreshold. Since a lot of data is read from the disk in reverse order, you should probably set this to a quite large value for good performance. NProcessors=1 Number of processors in a multiprocessing system. For normal, single-processor desktop computers the default value of 1 should be used. Not all versions of apfloat use this parameter. Currently multithreaded versions of the six-step Fast Number Theoretic Transform are implemented for Win32 threads and Posix threads. Also a multiprocessing program for calculating pi is included in the apfloat package. All of the above parameters can also be specified as environment variables. The environment variables should be in uppercase (for example, RAMSIZE). The environment variables override the settings in apfloat.ini, if both exist on a system. A MAXBLOCKSIZE environment variable can also be specified, which will override the setting calculated from RAMSIZE. This variable can be used to directly specify the maximum available memory block size, in modints. It should be used with caution.