mpn_invert implementing ApproximateReciprocal.

Torbjorn Granlund tg at gmplib.org
Tue Dec 15 20:07:21 CET 2009


bodrato at mail.dm.unipi.it writes:

  > "Exact approximation" is a bit odd.  The value computed is an
  > approximation (B^{2n}-1)/D, but is exactly floor((B^{2n}-1)/D).
  > I.e. no approximation compared to the ideal value.
  
  Does "Exact truncation" sound better?
  
I'd suggest "exactl result" or "strict result".

  I guess MUL_TO_MULMOD_BNM1_2NXN_THRESHOLD will have a value similar to
  INV_MULMOD_BNM1_THRESHOLD.
  On all machines running daily test we have
  INV_MULMOD_BNM1_THRESHOLD < BINV_NEWTON_THRESHOLD.
  
yesterday, I actually wrote (correct) code for tuning
MUL_TO_MULMOD_BNM1_2NXN_THRESHOLD, and ran it on a couple of machines.
Since it was always smaller than BINV_NEWTON_THRESHOLD, I decided to
exclude it.  It is easy enough to fix this if it becomes relevant by
some change.

  Probably mpn_binvert does not actually need a threshold for mulmod_bnm1.
  
Indeed.  It is gone.

-- 
Torbjörn


More information about the gmp-devel mailing list