Fast Multiplication

Torbjörn Granlund tg at
Fri Nov 20 08:17:04 UTC 2015

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.

Please encrypt, key id 0xC8601622

More information about the gmp-discuss mailing list