[Cuis-dev] Problems in class Number
Agustín Sansone
agustinsansone7 at gmail.com
Fri Oct 11 10:59:16 PDT 2019
Latest code you sent:
Time millisecondsToRun:
[1 to: 10000000 do: [:e | e isPrimeFast]]. 16025
Latest code I sent:
Time millisecondsToRun:
[1 to: 10000000 do: [:e | e isPrimeFast]]. 14435
El vie., 11 oct. 2019 a las 2:09, Andres Valloud via Cuis-dev (<
cuis-dev at lists.cuis.st>) escribió:
> Euclid's gcd algorithm converges to the answer exponentially with base
> phi. Larger small integers help amortize the extra cost.
>
> On 10/10/19 21:53, Phil B wrote:
> > Was that primarily due to the 64-bit version mostly fitting within
> > SmallInteger? I find many numeric performance issues just melt away by
> > staying away from Large*Integer (and Fraction)... they're great for
> > maintaining accuracy, lousy for performance. As in multiples to orders
> > of magnitude worse depending on what you're doing.
> >
> > On Fri, Oct 11, 2019 at 12:40 AM Andres Valloud via Cuis-dev
> > <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>> wrote:
> >
> > Fascinating --- the gcd approach was pretty bad in 32 bit land.
> > However, in 64 bits, the gcd batches are large enough to amortize the
> > cost, and that detects most composites without sending sqrtFloor.
> The
> > small integer threshold is now 91 squared.
> >
> > On 10/10/19 20:37, Agustín Sansone via Cuis-dev wrote:
> > > Well, what do you think? Are we done going over this poor
> > method?
> > >
> > >
> > > Okay, I'm happy with this version.
> > >
> > --
> > Cuis-dev mailing list
> > Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
> > https://lists.cuis.st/mailman/listinfo/cuis-dev
> >
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191011/b8297d90/attachment-0001.htm>
More information about the Cuis-dev
mailing list