Purpose of __gmpn_invert_limb?

Torbjörn Granlund tg at gmplib.org
Sat Mar 10 14:49:43 UTC 2018


Alexander Quilliam <alexkquilliam at gmail.com> writes:

  I've been in the process of profiling my code (using google perftools), and
  I've noticed that a function called __gmpn_invert_limb has been taking more
  than 18% of the CPU time of my code. What does this function do, and why is
  it so expensive? Is there a way to cut back on its usage?

It computes an approximate inverse of a limb, both typically 64-bit
positive integers.  The result is used by high-level division functions
e.g. mpz_tdiv_q.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-discuss mailing list