User Tools

Site Tools


notes:fall2024:projects:pnc1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:fall2024:projects:pnc1 [2024/10/16 21:42] – [MrVengeance's pnc1 runtimes] gsalcenotes:fall2024:projects:pnc1 [2024/10/17 01:51] (current) bpatrice
Line 55: Line 55:
 </code> </code>
 ====variant: sqrt point==== ====variant: sqrt point====
 +Say you're using i for the outer loop and j for the inner loop, now rather that j < i you want j * j < = i
 +<code>
 +START TIMEKEEPING
 +NUMBER: FROM 2 THROUGH UPPERBOUND:
 +    ISPRIME <- YES
 +    FACTOR: FROM 2 * 2 THROUGH NUMBER-1:
 +        SHOULD FACTOR DIVIDE EVENLY INTO NUMBER:
 +            ISPRIME <- NO
 +    PROCEED TO NEXT FACTOR BY TWO
 +    SHOULD ISPRIME STILL BE YES:
 +        INCREMENT OUR PRIME TALLY
 +PROCEED TO NEXT NUMBER BY TWO
 +ONCE UPPERBOUND IS REACHED ADD A ONE TO YOUR PRIME TALLY TO ACCOUNT FOR NOT STARTING AT TWO
 +STOP TIMEKEEPING
 +</code>
  
  
Line 78: Line 93:
 </code> </code>
 ====variant: break+sqrt==== ====variant: break+sqrt====
 +Same as sqrt but add a break
 +<code>
 +START TIMEKEEPING
 +NUMBER: FROM 2 THROUGH UPPERBOUND:
 +    ISPRIME <- YES
 +    FACTOR: FROM 2 * 2 THROUGH NUMBER-1:
 +        SHOULD FACTOR DIVIDE EVENLY INTO NUMBER:
 +            ISPRIME <- NO
 +            BREAK
 +    PROCEED TO NEXT FACTOR BY TWO
 +    SHOULD ISPRIME STILL BE YES:
 +        INCREMENT OUR PRIME TALLY
 +PROCEED TO NEXT NUMBER BY TWO
 +ONCE UPPERBOUND IS REACHED ADD A ONE TO YOUR PRIME TALLY TO ACCOUNT FOR NOT STARTING AT TWO
 +STOP TIMEKEEPING
 +</code>
  
  
 ====variant: break+odds+sqrt==== ====variant: break+odds+sqrt====
  
 +For this version, you will combine all three of the above into one process!
 =====ALGORITHM: sieve of eratosthenes===== =====ALGORITHM: sieve of eratosthenes=====
  
Line 176: Line 207:
 ====MrVengeance's pnc1 runtimes==== ====MrVengeance's pnc1 runtimes====
 {{ :notes:fall2024:projects:pnc1-graph.png?600 |}} {{ :notes:fall2024:projects:pnc1-graph.png?600 |}}
 +====XaViEr'S pnc1 runtimes====
 +{{ :notes:fall2024:projects:xavierspnc.png?600 |}}
 +
 +====Cburling's pnc1 runtimes====
 +{{:notes:fall2024:projects:cb-pnc1.png?400|}}
 +
 +====Blaize Patricelli pnc1 runtimes====
 +<dataplot center linespoints smooth 600x400 xlabel="range" ylabel="time (s)">
 +1024 0.483 0.083 0.033 0.17 0.033 0.0 0.017 0.0
 +2048 1.967 0.283 0.117 0.017 0.133 0.017 0.017 0.0
 +4096 7.867 1.017 0.467 0.05 0.467 0.05 0.017 0.017
 +8192 31.367 3.683 1.717 0.117 1.717 0.100 0.05 0.05
 +</dataplot>
 +
 +
notes/fall2024/projects/pnc1.1729114922.txt.gz · Last modified: 2024/10/16 21:42 by gsalce