• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

primal puts raw power into prime numbers.

primal

crates.io documentation minimum rustc 1.36

primal puts raw power into prime numbers.

This crates includes

  • optimised prime sieves
  • checking for primality
  • enumerating primes
  • factorising numbers
  • estimating upper and lower bounds for Ο€(n) (the number of primes below n) and pk (the kth prime)

This uses a state-of-the-art cache-friendly Sieve of Eratosthenes to enumerate the primes up to some fixed bound (in a memory efficient manner), and then allows this cached information to be used for things like enumerating and counting primes.

primal takes around 2.8 seconds and less than 3MB of RAM to count the exact number of primes below 1010 (455052511) on the author's laptop (i7-3517U).

Documentation

More Repositories

1

travis-cargo

A standalone script that manages running Rust's cargo and several other related features on Travis CI.
Python
175
star
2

simple_parallel

Straight-forward functions and types for basic data parallel operations.
Rust
93
star
3

simd

[DEPRECATED] see:
Rust
81
star
4

brainfuck_macros

A brainfuck procedural macro for Rust
Rust
57
star
5

rust-malloc

A pure Rust memory allocator
Rust
48
star
6

external_mixin

Put a program in your program, so you can program while you program.
Rust
44
star
7

ieee754

Low-level manipulations of IEEE754 floating-point numbers.
Rust
29
star
8

fast-math

Fast, approximate versions of mathematical functions
Rust
26
star
9

llvmint

Rust
25
star
10

unsafe_ls

List unsafe blocks and their unsafe actions in Rust crates
Rust
21
star
11

unicode_names

char <-> Unicode character name
Rust
20
star
12

cogset

Generic implementations of clustering algorithms.
Rust
20
star
13

float

Arbitrary precision floating point in Rust
Rust
19
star
14

spellck

A spell-checker for Rust code.
Rust
18
star
15

compile_msg

Compile-time user-defined diagnostics
Rust
17
star
16

cfor

A C-style for loop macro
Rust
13
star
17

order-stat

Compute order statistics
Rust
12
star
18

fftw3-rs

Bindings to FFTW3
Rust
10
star
19

alias

alias offers some basic ways to mutate data while aliased.
Rust
10
star
20

card-trace

Rust
10
star
21

boehm-rs

Rust
10
star
22

isrustfastyet

JavaScript
10
star
23

shared_slice

&[T] minus lifetimes
Rust
9
star
24

tz-search

Compute the timezone of latitude/longitude pairs.
Rust
9
star
25

slow_primes

Slow prime-related algorithms
Rust
8
star
26

repo-admin

Simple tools for batch github administration
Python
7
star
27

hamming

Compute the Hamming weight of a vector and the Hamming distance between two efficiently
Rust
7
star
28

strided-rs

Strided slices.
Rust
6
star
29

fractran_macros

A FRACTRAN procedural macro for Rust
Rust
6
star
30

sisfft-py

Python
5
star
31

char-iter

An iterator over a linear range of characters.
Rust
4
star
32

rust-resource-management

HTML
4
star
33

simd-hacks

Rust
4
star
34

multibuilder

Because you know you want hundreds of builds of a single repository
Rust
4
star
35

crates.io-graph

Draw graphs of crates.io packages
Rust
3
star
36

huonw.github.io

JavaScript
3
star
37

simdty

Rust
3
star
38

rust-rand

Now in std::rand. (Rewrite of rust random number handling)
Rust
3
star
39

crossworder

Make a crossword (using horrible Python code)!
Python
3
star
40

var

A Rust macro for declaring and initialising multiple mutable variables in a single statement.
Rust
3
star
41

photo-map

Sometimes visible at:
Rust
2
star
42

sisfft

R
1
star
43

melville-facing-the-singularity-edition

Wordpress theme for FacingTheSingularity.com
PHP
1
star
44

revisiting-knn

Rust
1
star
45

rust-android-html

Java
1
star
46

nbsphinx-consecutive-cell-reproducer

Reproducer for an nbsphinx issue
JavaScript
1
star