mpz_trial_div

Jason Moxham J.L.Moxham@maths.soton.ac.uk
Thu, 14 Nov 2002 16:14:16 +0000


On Thursday 14 Nov 2002 3:58 pm, Paul Leyland wrote:
> > From: Torbjorn Granlund [mailto:tege@swox.com]
> >
> > "Paul Leyland" <pleyland@microsoft.com> writes:
> >   > Possible , although I think it is unneccessairy (as we have
> >   > the mpz fn mpz_remove_ui) , consider
> >   >
> >   > d=3Dmpz_trial_div(N,1,10000);
> >   > m=3Dmpz_remove_ui(N,N,d);
> >   >
> >   > to cover the multiplicity case
> >
> >   Fair point.  Thanks.
> >
> > Not sure that would work.  Assume our number has the factor 3^2*5.
> > mpz_trial_div might find 3*5 and return that.  mpz_remove_ui
> > would then typically leave one factor 3.
> >
> > Since some usages of mpz_trial_div will only care if any factor is
> > found, we don't want to slow it down by having it figure out any
> > factor multiplicity.
>
> I thought we'd agreed, wrongly it appears, that mpz_trial_div would ret=
urn
> only prime factors and would always return the smallest such (perhaps i=
n
> the range start--end if those arguments are present).
>
>

if mpz_trial_div can return 3*5 say , then it gets very complicated (and =
SLOW)=20
, see my previous email on it , I recomend only returning prime factors i=
n=20
order .