[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-14 Thread Bill Hart
The solution is simply to add a function mpn_gcdext_min which guarantees a "minimal" solution which is invariant across platforms. It's more than a few percent to guarantee this in general, but the Sage doctesting framework isn't particularly tolerant of changes in output of functions. Of course

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-13 Thread jason
On Tuesday 13 January 2009 19:26:07 Carl Witty wrote: > On Jan 13, 2:38 am, ja...@njkfrudils.plus.com wrote: > > > > The other issue here is that there are multiple algorithms here and > > > > it is quite likely that very small examples will use the basic xgcd > > > > which may well guarantee mini

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-13 Thread Carl Witty
On Jan 13, 2:38 am, ja...@njkfrudils.plus.com wrote: > > > The other issue here is that there are multiple algorithms here and it > > > is quite likely that very small examples will use the basic xgcd which > > > may well guarantee minimality. Only if you have say hundreds of > > > thousands of bi

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-13 Thread jason
On Tuesday 13 January 2009 02:23:44 mabshoff wrote: > On Jan 12, 2:36 pm, Bill Hart wrote: > > Hi, > > > What Jason is saying (I think) is that currently xgcd (not gcd) > > doesn't use Moller's patches as such. It will in future, but not at > > the moment. So whatever guarantees you had before, y

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-12 Thread Bill Hart
I checked through the code quickly and indeed mpz_gcdext calls mpn_gcdext which simply implements the Lehmer algorithm (and some optimisations for one and to limb divisions). I'll do some work on the gcd and xgcd code for the next release. At the present time I'm working on something different.

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-12 Thread mabshoff
On Jan 12, 2:36 pm, Bill Hart wrote: Hi, > What Jason is saying (I think) is that currently xgcd (not gcd) > doesn't use Moller's patches as such. It will in future, but not at > the moment. So whatever guarantees you had before, you still have now. > But that will soon change. Ok, thanks fo

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-12 Thread Bill Hart
What Jason is saying (I think) is that currently xgcd (not gcd) doesn't use Moller's patches as such. It will in future, but not at the moment. So whatever guarantees you had before, you still have now. But that will soon change. The other issue here is that there are multiple algorithms here and

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-11 Thread mabshoff
On Jan 11, 9:20 pm, "Jason Martin" wrote: Hi, > No, we can't guarantee minimality.  The xgcd that you're seeing right > now in MPIR only uses Moller's code when it calls to gcd.  It isn't as > nice as the xgcd that is in GMP 4.3.  Hopefully, we will be able to > re-invent that wheel since I cou

[mpir-devel] Re: minimality guarantee for new xgcd?

2009-01-11 Thread Jason Martin
No, we can't guarantee minimality. The xgcd that you're seeing right now in MPIR only uses Moller's code when it calls to gcd. It isn't as nice as the xgcd that is in GMP 4.3. Hopefully, we will be able to re-invent that wheel since I couldn't find a LGPL v. 2+ version of Moller's xgcd code. C