Double factorial and primorial

Torbjorn Granlund tg at gmplib.org
Thu Dec 22 16:08:02 CET 2011


Joerg Arndt <arndt at jjj.de> writes:

  I think the data-dependent branches killed it for me
  (a simple binary heap was used).
  
My heap removal code avoids branches; the ceil(log n) operations has no
data dependent branch.

The insertion code has an amortised running time of O(1), but the
termination branch is data dependent.
  
You're welcome to look at my code and see if you can improve it.

-- 
Torbjörn


More information about the gmp-devel mailing list