Talk:Carmichael 3 strong pseudoprimes: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎listing in ascending order: added a tidbit about Carmichael numbers being odd. -- ~~~~)
(→‎optimization: added a new section. -- ~~~~)
Line 4: Line 4:


This would make some programs a wee bit faster starting at 3 instead of 2. -- [[User:Gerard Schildberger|Gerard Schildberger]] 06:58, 11 December 2012 (UTC)
This would make some programs a wee bit faster starting at 3 instead of 2. -- [[User:Gerard Schildberger|Gerard Schildberger]] 06:58, 11 December 2012 (UTC)

==optimization==

By changing the order of the '''if''' statements (in the definition of Prime1, Prime2, and Prime3) made the REXX program about three times faster, along with unrolling the compound '''if''' statements.

Also note that the REXX language doesn't have short circuits, so this is of concern with other languages not having that capability (short circuits). -- [[User:Gerard Schildberger|Gerard Schildberger]] 08:11, 11 December 2012 (UTC)


==listing in ascending order==
==listing in ascending order==

Revision as of 08:11, 11 December 2012

clarification of Carmichael 3 strong pseudomprimes

One small tidbit. Carmichael numbers can't be even, so Prime1 could be described as any odd prime ...

This would make some programs a wee bit faster starting at 3 instead of 2. -- Gerard Schildberger 06:58, 11 December 2012 (UTC)

optimization

By changing the order of the if statements (in the definition of Prime1, Prime2, and Prime3) made the REXX program about three times faster, along with unrolling the compound if statements.

Also note that the REXX language doesn't have short circuits, so this is of concern with other languages not having that capability (short circuits). -- Gerard Schildberger 08:11, 11 December 2012 (UTC)

listing in ascending order

I was thinking about listing the triplets in ascending order. It would be a nice feature when showing the results. -- Gerard Schildberger 22:07, 10 December 2012 (UTC)

Implemented. It does make the reading of the Carmichael numbers much easier to peruse. -- Gerard Schildberger 06:47, 11 December 2012 (UTC)

Python issues?

Having had two languages base their entries on the Python but mention with changes I thought I should ask what it is I have done wrong. (I'm braced, go ahead...)
--Paddy3118 06:02, 11 December 2012 (UTC)