Fast Multiplication

David Baumgärtel baumgaertel.david at
Tue Nov 24 08:08:04 UTC 2015

Thank you very much!
The file "speed.c" in /tune was exactly what I needed.
Now I have a question regarding the size parameter -s.
I tried to find out how s is measured. Am I right that s is defined as 64
on a 64-bit CPU? And how is a number looking like with for example s=1 or

Am 20.11.2015 09:17 schrieb "Torbjörn Granlund" <tg at>:

> David Baumgärtel <baumgaertel.david at> writes:
>   I am a german student and I have a problem regarding the multiplication
>   algorithms. I need to adjust the thresholds "MUL_KARATSUBA_THRESHOLD" and
>   so on to force the usage of a particular multiplication algorithm. But
> that
>   doesn't work like I want it to work, because the .h and .c files in which
>   the algorithms are defined are precompiled.
>   Is there any chance of changing the thresholds that I can compare the
>   run-time of the different multiplication algorithms for equal inputs.
>   Thank you very much for your effort!
> If you see MUL_KARATSUBA_THRESHOLD, then you have ages old source code.
> Please start by upgradig to a contemporary version of GMP.
> I am not sure what you mean by that .h and .c files are "precompiled".
> You should get GMP sources and compile the library yourself.
> For timing experiments, compile tume/speed.  It's not docuimented, but
> the sources should be readable enough.  This program can directly
> compare the speed of the various underlying multiplicaiton primitives.
> --
> Torbjörn
> Please encrypt, key id 0xC8601622

More information about the gmp-discuss mailing list