On Sep 4, 11:03 am, Jeff Gilchrist <[email protected]> wrote:
> On Thu, Sep 3, 2009 at 10:51 PM, Jason Moxham<[email protected]> 
> wrote:
> > Or getting rid of the mpz_next_prime_thing all-together , cant say I like it
> > much. What do people use it for ?
>
> I actually use it and find it very useful.  If I'm doing some kind of
> testing or other calculations on increasing primes it is very useful
> just to call that function to get the next one to work with.
>
> Right now unless you dig into the code it is hard to tell what the two
> current prime functions really do.  So a new defined function that
> either provides a way to specify the algorithm to use or have
> something very clearly defined would be a great benefit.  If someone
> is trying to do work that needs to be repeatable it would be good to
> have a way for people to say, "Use MPIR with this is_prime/prob_prime
> function using these parameters"
>
> Jeff.

Hi , did you mean that results should be repeatable across different
arch's ie 64/32bit ? or just repeatable on a set arch?
For a set arch and random seed then everything is repeatable. For a
set random seed and any arch then the urandom functions (uniformly
distributed) are repeatable(or should be!!!) , the rrandom fn's are
not. The mpz_probable_prime_p fn is "not" , although this is only
because on some arch'es it may be faster to do more trial division
than on others and so if you are (un)lucky you will give  the function
a number which is composite but passes the miller-rabin test but fails
the trial div test. The mpz_likely_prime_p test is optimized for speed
so has no guarentee , same for mpz_next_likely_prime_p.

Jason


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to