speed enhancement

Paul Zimmermann Paul.Zimmermann at loria.fr
Fri Oct 8 18:10:17 CEST 2010


       Torbjörn,

>   the comments say that in case of the recursive call, {sp,sn} is either the
>   correct root or one too large. But if one too large and sp[0]=0, then returning
>   {sp+1,sn-1} as we do is incorrect.
>   
>   However after several millions random tests with mpn_random2, k=2 and
>   input a square minus 1 (which should be the worst case for {sp,sn}
>   possibly one too large) I was unable to find a corner case. Maybe
>   the algorithm always returns the correct {sp,sn}?
>   
> I will investigate this further.
> 
> Did you test on a 32-bit or 64-bit machine?  The question may seem
> irrelevant, but it is actualoly easier to trigger this sort of bugs
> using smaller words.

I only tried on a 64-bit machine.

Paul


More information about the gmp-devel mailing list