speed of mpq_cmp vs mpq_sub

Torbjörn Granlund tg at gmplib.org
Sun May 22 14:19:50 UTC 2016


Marc Glisse <marc.glisse at inria.fr> writes:

  I am also surprised, but it is rather easy to reproduce. Maybe you'll
  see a bug in my test program?

Your program looks OK.

I suppose multiplying 3 and 5 might make mpq_sub measurements unreliable
if the result of the multiplying yielded non-canonical form.

Using some other constants which are less likely to be contained in the
operands might be a lazy fix (say 101 and 103).

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


More information about the gmp-discuss mailing list