Exact number types built from msets, in Raya
Multiply polynomials exactly as arrays of counts, compose matrices exactly, and keep small rationals in two registers. Msets, polynumbers, multinumbers, maxels, vexels, boxes and Rat64 as Raya types, with their definitions and laws, measured against C, GMP and Raya's BigInt on Arm and x86. Wins and losses.
Research note, 30 November 2026. Samario Torres, Riptide. A prototype, not a shipped Raya library.
These types follow N J Wildberger's construction of arithmetic from msets in his Math Foundations series (Insights into Mathematics); the lectures used are listed under Sources.
An mset is an unordered list with repetition. Store an mset as its counts and three familiar objects become arrays of small integers: a polynomial is an mset of naturals, a matrix is an mset of pixels, a natural number is an mset of one mark. This note builds those types in Raya, with exact arithmetic on the counts, and measures what they buy.
Short answer. It pays off where the counts are small numbers that fit in a byte, so the CPU's SIMD units can work on many of them at once.
- Polynumbers (msets of naturals). Exact polynomial products on Graviton3 run faster than C's scalar loop and than GMP for degrees from about 256 to 1,024, and about 5,000 times faster than a one-object-per-element version.
- Maxels and bipolynumbers. 760 to 2,300 times faster than the object versions, all exact.
- Where it does not pay. Natural numbers written out as msets of ones or zeros (tallies) are exponentially large. The box of zeros only becomes usable once it is compressed to a count, and that count is an ordinary
int(or aBigInt).
111 property tests pass on Arm and x86. Every timed result was first checked against a second implementation.
What you can do with these types
- Multiply polynomials exactly, as counts, at SIMD speed (
PolyMset): degree 1,024 in 87 µs on Graviton3, against 97 µs for GMP and 252 µs for C. - Build matrices that compose exactly (
DenseMaxel): 0/1 maxels of 512 × 512 multiply in 10.3 ms, with counts that widen instead of overflowing. - Convolve 2-D arrays exactly (
BipolyMset): 32 × 32 in 0.47 ms. - Do algebra in many variables (
Multinumber): products of 2,048 × 2,048 terms in 0.61 s. - Count divisors and invert the divisibility order with the caret and the Möbius maxel.
- Keep small rationals in two registers (
Rat64): a + b in 100 ns, 8 times faster than a BigInt rational.
Every operation is exact or raises ExactOverflow; nothing wraps. Counts widen from int (64-bit) to BigInt automatically, the way int and BigInt relate.
Msets: sum, union and intersection
What it does. CountMset stores an mset over an alphabet as one count per letter. Pooling two msets is one pass of additions: over an alphabet of 65,536 letters it takes 116 µs, against 205 µs for Raya's scalar loop and 3.1 ms for a Map<int, int>.
Example. With A = [a a b] and B = [a c]:
- A + B = [a a a b c] (pool both),
- A ∪ B = [a a b c] (the larger count of each letter),
- A ∩ B = [a] (the smaller count).
The mathematics. An mset over a set is a function that is zero outside a finite set; is the multiplicity of , and order does not matter, so [a a b] = [a b a]. The three operations act on multiplicities:
All three are commutative and associative. Sum distributes over union and over intersection, and ; union and intersection absorb each other, ; and sum cancels, .
Measured. The win above is against Raya's own loop and maps. C's auto-vectorised int32 add is 4 to 11 times faster than our count layout, and at alphabet 16 our vector path is slower than a plain loop.
Natural numbers and integers as msets
What it shows. A natural number is the simplest mset, and writing it out is the clearest way to see why int exists.
The mathematics. The natural is the mset of copies of one mark (or, in the box form, empty boxes, with ). Sum pools the two msets; product takes every pair, one element from each, with mark × mark = mark, so . Both are commutative and associative, and product distributes over sum.
Integers add anti-elements: an anti-mark cancels a mark, and anti × anti = mark is a definition chosen so the laws survive. Stored as a signed count per element, every law above still holds. In a variant with an anti-zero, distributivity fails at level zero, but ; that variant is kept only in the one-object-per-element reference.
Example. 3 + 2 = [| | |] + [| |] = [| | | | |] = 5, and 3 × 2 has 3 · 2 = 6 pairs.
Measured. The tally costs bytes, and a -bit number needs bytes: 10⁷ + 10⁷ takes 6.1 ms against about 1 ns for int. Compressed to its count, the mset is int (and BigInt beyond 64 bits).

int), and as a base-2 vexel (binary 110).Polynumbers: multiply polynomials exactly as counts
What it does. PolyMset holds a polynomial with natural coefficients as its list of counts and multiplies it exactly. With counts 0 … 255 at degree 256 the product takes 12.3 µs on Graviton3, against 16.0 µs for C's int64 loop, 18.9 µs for GMP and 63.8 ms for the object version (5,200×). Counts widen to int64 and then to BigInt when they grow.
Example. [2 3] × [1 1 0] = [3 3 2 4 4 3]. Read as polynomials, [2 3] = and [1 1 0] = , and the product [2 3 3 3 4 4] is . Likewise [0 0 1 1 1 2 3 3 3 3] = .
The mathematics. A polynumber is an mset of naturals. Its multiplicity list , with the number of copies of , is a coefficient list, and the polynumber is . Sum pools the msets, so coefficients add. Product adds every pair:
which is exactly polynomial multiplication. Sum and product are commutative and associative, and product distributes over sum.
Measured. At degree 1,024: ours 87 µs, GMP 97 µs, C 252 µs. Below degree about 128 C's scalar loop is faster (degree 64: C 1.1 µs, ours 2.9 µs). Past degree about 2,000 GMP's subquadratic multiplication wins (degree 4,096: GMP 0.54 ms, ours 0.96 ms), and with 40-bit counts we are 15 to 30 times behind GMP because Raya's BigInt is the bottleneck.

PolyMset: a polynumber as its multiplicity list, int64 counts or a packed byte layout for small counts.The caret: exponentiation of msets
What it does. The caret multiplies elements where the product adds them. On polynumbers of degree 256 it takes 0.66 ms, against 5.6 ms with Raya's BigInt.
Example. [1 2 … n] ^ [1 2 … n] contains every product , so the multiplicity of each is the number of divisors of . The caret product of the polynumbers [1, p, p², …] over the primes , cut at , is [1, 2, …, n]: that is unique factorisation (Euler's product).
The mathematics.
The caret is commutative and associative and distributes over sum, . The polynumber [1] is its identity, and (with ) counts : it is copies of 0, the natural .

PackedPoly: a small polynumber in one 64-bit word, the monomial of a multinumber.Multinumbers: polynomials in many variables
What it does. Multinumber multiplies polynomials in many variables with integer coefficients: 15 terms in 20.6 µs against 253 µs for the object version (12×), the caret in 6.0 µs against 54 µs (9×), and 2,048 × 2,048 terms (4.2 M term pairs, 676 k result terms) in 0.61 s. The one-object-per-element version did not finish in 30 minutes; it takes 41 minutes at 512 terms and grows as n^4.0 (about 6 days at 2,048, extrapolated). For comparison, FLINT's fmpz_mpoly does the same product in about 9 ms, so for large sparse products FLINT remains the faster tool.
The mathematics. A multinumber is an mset of polynumbers. The variables are , the mset holding the single polynumber [n], and sum, product and caret are defined exactly as before, one level up. The result is ordinary algebra in the variables .
Example. . The tests also check the nested caret [[1 2] 4] ^ [0 [0 3]].
Maxels: matrices that compose exactly
What it does. DenseMaxel stores a matrix as counts and multiplies it exactly. With 0/1 counts at 512 × 512 the product takes 10.3 ms, against 22 ms for C's int64 loop (C's byte loop, 4.6 ms, is faster); at 64 × 64 the object version takes 32.7 ms against our 43 µs (760×).
Example. [1, 2] · [2, 3] = [1, 3], and [1, 2] · [3, 1] = 0, because the inner indices 2 and 3 differ.
The mathematics. A pixel is a pair and a maxel is an mset of pixels. Pixels multiply by
and the product extends to any two maxels by taking every pair, so the count at is : an integer matrix product over the shared middle index. The product is associative and reverses under transpose, with . For a set , the partial identity keeps the rows (on the left) or columns (on the right) in .
The Möbius maxel. The divisibility maxel on 1 … n has the inverse , so inverting gives the Möbius function. For that takes 82 µs, against 748 µs for the object version.

Bipolynumbers: exact 2-D convolution
What it does. BipolyMset multiplies polynomials in two variables, which is a 2-D convolution: 32 × 32 in 0.47 ms, against 1.10 s for the object version (2,300×).
The mathematics. A bipolynumber is a finite 2-D array of numbers , the polynomial . The product is
Example. : a 2 × 1 array of ones times a 1 × 2 array of ones is the 2 × 2 array of ones.
Vexels: where BigInt is already the answer
What it shows. A vexel is the mset picture of positional notation. The measurement says the existing BigInt is that picture, already normalised.
The mathematics. A vexel is an mset of singletons , with , so vexels multiply like polynumbers. A base-2 vexel adds the exchange rule , and two vexels are equal when one can be reached from the other by exchanges. The normalised base-2 vexel, with every count 0 or 1, is the binary expansion.
Example. 6 = [1] + [2] = binary 110, and [1] + [1] + [2] = [2] + [2] = [3] = 8.
Measured. Deferring carries (base , = 8 or 16) does not pay: the product is 8 to 48 times slower than Raya's BigInt (4,096 bits: 43 µs against 5.4 µs; GMP 2.1 µs), and summing many 1,024-bit numbers costs 65 ns per term against 37 ns.
Boxes: nested boxes at real sizes
What it does. BoxPool makes nested-box arithmetic usable at real sizes by storing every distinct box once. The natural 10⁹ is one (child, multiplicity) pair, and the product of boxes of naturals up to takes 42 µs, flat in , against 4.2 ms and growing for the object version (100×).
The mathematics. In box arithmetic every number is a box, an mset of boxes: , the natural is a box of zeros, and a polynumber is a box of naturals, so the same sum, product and caret apply at every level of nesting.
Measured. On small random boxes (depth 3, tiny naturals) the pool is 2 to 8 times slower than the object version; it wins only when elements repeat or naturals are large.

BoxPool: every distinct box is stored once; the natural 10⁹ is one pair.Rationals: Rat64
What it does. Rat64 keeps a rational as two int64 in lowest terms and adds two rationals with 8-bit parts in 100 ns, against 835 ns for Raya's BigInt rational (8×). It falls back to the BigInt rational when a result does not fit.
The mathematics. A rational is a pair of integers with , and when . Then
and the field laws hold. In lowest terms with each rational has one representation, so Raya's generated value-class equality is rational equality.
Example. .
Measured. Rat64 is 1.3 to 3.5 times behind GMP's mpq (8-bit parts: 100 ns against 78 ns; 30-bit parts: 365 ns against 103 ns).

Rat64: an exact rational in two registers.The Raya types and how each one sits in memory
| Raya type | What it stores | Mathematical type | Relation to int and BigInt |
|---|---|---|---|
ByteMset | one byte per element: the natural n is n zero bytes (a tally) | natural number as an mset of zeros | the uncompressed box; a b-bit number needs 2ᵇ bytes |
CountMset | one int32 count per letter, in a packed layout for the CPU's SIMD units | mset over an alphabet | union and intersection are max and min of counts |
PolyMset | one count per natural: int64 counts, BigInt counts when a count outgrows int64; byte counts for small counts | polynumber (an mset of naturals) | a box of zeros compressed to its count is int |
PackedPoly | a small polynumber in one 64-bit word, one byte per natural 0 … 7 (a value class) | a monomial of a multinumber | the standard packed-monomial layout of computer algebra |
Multinumber | sorted (word, int64 count) pairs, 16 bytes per distinct monomial | multinumber | polynomials in many variables with integer coefficients |
DenseMaxel | rows × columns of counts | maxel | the product is an integer matrix product over the shared middle index |
BipolyMset | the same array as a maxel | bipolynumber | the product is a 2-D convolution |
VexelNat | one count per position, base 2ᵏ (k = 8 or 16), carries deferred | vexel | the normalised vexel is BigInt's binary digits |
BoxPool | hash-consed boxes: every distinct box stored once, as (child id, multiplicity) pairs | nested boxes | the natural 10⁹ is one pair; equality is id equality |
Rat64 | two int64 in lowest terms, denominator > 0 (a value class, kept in registers) | rational number | falls back to a BigInt rational |

CountMset: one int32 count per letter, packed for the CPU's SIMD units.Laws and how they are tested
raya test runs 111 tests, and all pass on Arm (Graviton3) and x86 (Xeon) with Raya 0.4.0.
- Every law above is a seeded property test: 40 to 300 random cases each, for sum, union, intersection, product and caret on every type (commutativity, associativity, distributivity, identities, absorption, cancellation, (A+B)^C = A^C + B^C, 1 ^ A = the count of A, transpose of a product).
- Every type is cross-checked against a straightforward one-object-per-element implementation (boxes, msets as sorted lists, polynumbers and bipolynumbers over the rationals, maxels as maps of pixels) or against
BigIntand the BigInt rational. - The worked examples are tests: [2 3] × [1 1 0] = [3 3 2 4 4 3]; [0 3] × [1 4] × [2 7]; (4, 1)·(3, 7); [0 0 1 1 1 2 3 3 3 3] = 2 + 3α + α² + 4α³; a maxel product of pixels; the caret [[1 2] 4] ^ [0 [0 3]]; the multinumber caret (1 + α₀ + α₁) ^ (1 + α₀²); Euler's product ∏^[1, p, p², …] = [1, 2, …, n]; [1 … n] ^ [1 … n] = the divisor counts; and the Möbius function from the divisibility maxel.
- Every product implementation of a type is tested equal to the others on random inputs.
- Every benchmark row is checked against a second implementation before it is timed.
Testing found three bugs in the prototype's own tests, all fixed before the measurements: a comparison that relied on an unnormalised compareTo, a 40-bit Rat64 test that expected results which legitimately overflow, and a multinumber benchmark that asked for 15 distinct polynumbers from a space of 8.
Results
Measured on AWS Graviton3 (Arm) and Intel Xeon (x86), one thread, against C (gcc -O3) and GMP; times are per operation on Arm unless stated. Full setup under Method details at the end.
Where the mset layouts win
| What | Ours | Others |
|---|---|---|
| Polynumber product, counts 0 … 255, degree 256 | 12.3 µs | C int64 16.0 µs, GMP 18.9 µs, object version 63.8 ms (5,200×) |
| Polynumber product, degree 1,024 | 87 µs | GMP 97 µs, C 252 µs |
| Caret A ^ B, degree 256 | 0.66 ms | Raya BigInt 5.6 ms |
| Maxel product, 0/1 counts, 512 × 512 | 10.3 ms | C int64 22 ms (C byte loop 4.6 ms is faster); object version at 64 × 64: 32.7 ms against our 43 µs (760×) |
| Möbius maxel, n = 64 | 82 µs | object version 748 µs |
| Bipolynumber product, 32 × 32 | 0.47 ms | object version 1.10 s (2,300×) |
| Multinumber product, 15 terms | 20.6 µs | object version 253 µs (12×); caret 6.0 µs against 54 µs (9×) |
| Multinumber product, 2,048 × 2,048 terms | 0.61 s (4.2 M term pairs, 676 k result terms) | object version did not finish in 30 min (41 min at 512 terms); FLINT fmpz_mpoly ≈ 9 ms |
| Boxes of naturals up to n = 1,000: product | 42 µs, flat in n | object version 4.2 ms, growing with n (100×) |
| Rationals with 8-bit parts: a + b | 100 ns | Raya BigInt rational 835 ns (8×); GMP mpq 78 ns |
| Mset sum, alphabet 65,536 | 116 µs | Raya scalar loop 205 µs, Map<int, int> 3.1 ms |
Where they lose
- Tallies (unary naturals). The tally costs n bytes: 10⁷ + 10⁷ takes 6.1 ms against about 1 ns for
int; 1,000 × 1,000 writes a million bytes in 341 µs. A b-bit number needs 2ᵇ bytes. The box of zeros is only usable compressed, and the compression isint(BigIntbeyond 64 bits). - Vexels as a bignum. Deferring carries does not pay: the product is 8 to 48 times slower than Raya's
BigInt(4,096 bits: 43 µs against 5.4 µs; GMP 2.1 µs), and summing many 1,024-bit numbers costs 65 ns per term against 37 ns.BigIntalready is the normalised vexel. - GMP at large sizes. Past degree about 2,000, GMP's subquadratic multiplication beats our quadratic products (degree 4,096: GMP 0.54 ms, ours 0.96 ms). Polynumbers with 40-bit counts are 15 to 30 times behind GMP; Raya's
BigIntis the bottleneck there. - Small polynumbers. Below degree about 128, C's scalar int64 loop is faster (degree 64: C 1.1 µs, ours 2.9 µs).
- x86. Raya has no SIMD intrinsics on x86-64 yet, so the byte layouts run scalar code there (polynumber degree 4,096: 55 ms against 27 ms for int64 counts) and C is 3 to 6 times faster. The Xeons do have the matching SIMD instructions, so this is a compiler gap, not a hardware one.
- Small random boxes. The hash-consed pool is 2 to 8 times slower than the object version on depth-3 boxes of tiny naturals; it wins only when elements repeat or naturals are large.
- Rationals against GMP.
Rat64is 1.3 to 3.5 times behind GMP's mpq (8-bit parts: 100 ns against 78 ns; 30-bit parts: 365 ns against 103 ns). - Mset counts against C. C's auto-vectorised int32 add is 4 to 11 times faster than our count layout; at alphabet 16 our vector path is slower than a plain loop.
Charts
Each chart shows arm64 on the left and x64 on the right, log scales, nanoseconds per operation.

BigInt and the object versions.






int, BigInt and GMP.

BigInt and GMP: vexels lose.





Memory
| Value | Ours | Object version |
|---|---|---|
| natural 100 | 8 B as an int; one 16 B pool pair; 100 B as a tally | 1,370 B |
| polynumber, degree 64 | 520 B (int64 counts), 65 B (byte counts) | 7,100 B (polynumber over the rationals) |
| maxel 32 × 32, half full | 8,192 B (int64), 1,024 B (bytes) | 20,700 B (map of pixels) |
| rational | 16 B in registers (31 B when boxed in a list) | two BigInts |
| polynumber inside a multinumber | 8 B word + 8 B count | a box of boxes |
Every measurement
Show all 286 rows (ns per operation; blank = not run on that architecture, — = memory-only row)
| case | operation | size | implementation | arm64 ns | x64 ns | bytes |
|---|---|---|---|---|---|---|
| bipoly | mul | 8 | ours: byte counts, SIMD | 1.845e+04 | 3.109e+04 | 512 |
| bipoly | mul | 8 | reference: Bipolynumber over Q | 4.49e+06 | 5.525e+06 | |
| bipoly | mul | 32 | ours: byte counts, SIMD | 4.703e+05 | 3.619e+06 | 8192 |
| bipoly | mul | 32 | reference: Bipolynumber over Q | 1.095e+09 | 1.378e+09 | |
| bipoly | mul | 128 | ours: byte counts, SIMD | 5.644e+07 | 8.683e+08 | 131072 |
| caret | caret | 16 | Raya BigInt | 1.417e+04 | 1.801e+04 | |
| caret | caret | 16 | ours: int64 kernel | 1359 | 2144 | 136 |
| caret | caret | 16 | reference: sorted element list (Mset) | 7.744e+08 | 9.639e+08 | |
| caret | caret | 64 | Raya BigInt | 2.131e+05 | 2.491e+05 | |
| caret | caret | 64 | ours: int64 kernel | 2.075e+04 | 3.116e+04 | 520 |
| caret | caret | 256 | Raya BigInt | 5.6e+06 | 7.597e+06 | |
| caret | caret | 256 | ours: int64 kernel | 6.606e+05 | 9.912e+05 | 2056 |
| caret | caret | 1024 | Raya BigInt | 2.056e+08 | 2.636e+08 | |
| caret | caret | 1024 | ours: int64 kernel | 1.106e+07 | 1.508e+07 | 8200 |
| caret | caret | 4096 | ours: int64 kernel | 2.252e+08 | 4.809e+08 | 32776 |
| hbox | caret | 2 | ours: hash-consed boxes | 6836 | 7856 | |
| hbox | caret | 2 | reference: one object per element (Box) | 1468 | 1720 | |
| hbox | caret | 3 | ours: hash-consed boxes | 9768 | 1.114e+04 | |
| hbox | caret | 3 | reference: one object per element (Box) | 4178 | 5008 | |
| hbox | caret | 4 | ours: hash-consed boxes | 1.968e+04 | 2.124e+04 | |
| hbox | caret | 4 | reference: one object per element (Box) | 1.686e+04 | 1.876e+04 | |
| hbox | mul | 2 | ours: hash-consed boxes | 6184 | 7045 | |
| hbox | mul | 2 | reference: one object per element (Box) | 784.8 | 896.9 | |
| hbox | mul | 3 | ours: hash-consed boxes | 8286 | 9296 | |
| hbox | mul | 3 | reference: one object per element (Box) | 1894 | 2264 | |
| hbox | mul | 4 | ours: hash-consed boxes | 1.496e+04 | 1.628e+04 | |
| hbox | mul | 4 | reference: one object per element (Box) | 2827 | 3138 | |
| hboxnat | caret | 10 | ours: hash-consed boxes | 1.797e+04 | 2.091e+04 | |
| hboxnat | caret | 10 | reference: one object per element (Box) | 2.707e+05 | 3.133e+05 | |
| hboxnat | caret | 1000 | ours: hash-consed boxes | 5.62e+04 (Graviton2) | 4.861e+04 | |
| hboxnat | caret | 100000 | ours: hash-consed boxes | 4.054e+04 | 4.732e+04 | |
| hboxnat | mul | 10 | ours: hash-consed boxes | 1.334e+04 | 1.554e+04 | |
| hboxnat | mul | 10 | reference: one object per element (Box) | 5.552e+04 | 7.057e+04 | |
| hboxnat | mul | 1000 | ours: hash-consed boxes | 4.226e+04 (Graviton2) | 3.641e+04 | |
| hboxnat | mul | 1000 | reference: one object per element (Box) | 4.174e+06 (Graviton2) | 3.568e+06 | |
| hboxnat | mul | 100000 | ours: hash-consed boxes | 3.042e+04 | 3.55e+04 | |
| maxel | mobius | 16 | ours: int64 kernel | 2008 | 3928 | |
| maxel | mobius | 16 | reference: Maxel as a map of pixels | 3.86e+04 | 4.935e+04 | |
| maxel | mobius | 64 | ours: int64 kernel | 8.19e+04 | 1.761e+05 | |
| maxel | mobius | 64 | reference: Maxel as a map of pixels | 7.483e+05 | 9.256e+05 | |
| maxel | mobius | 256 | ours: int64 kernel | 5.464e+06 | 1.002e+07 | |
| maxel | mul | 16 | C int64, gcc -O3 -march=native | 666.8 | 966.8 | 2048 |
| maxel | mul | 16 | C u8 dot, gcc -O3 -march=native | 501.9 | 1168 | 256 |
| maxel | mul | 16 | ours: int64 kernel | 3748 | 5089 | 2048 |
| maxel | mul | 16 | ours: int64 kernel, counts ±1000 | 6139 | 7055 | 2048 |
| maxel | mul | 16 | reference: Maxel as a map of pixels | 2.717e+05 | 3.019e+05 | |
| maxel | mul | 16 | ours: byte counts, SIMD | 2396 | 1.783e+04 | 2048 |
| maxel | mul | 64 | C int64, gcc -O3 -march=native | 3.22e+04 | 6.663e+04 | 32768 |
| maxel | mul | 64 | C u8 dot, gcc -O3 -march=native | 1.127e+04 | 3.62e+04 | 4096 |
| maxel | mul | 64 | ours: int64 kernel | 1.87e+05 | 2.061e+05 | 32768 |
| maxel | mul | 64 | ours: int64 kernel, counts ±1000 | 3.61e+05 | 3.496e+05 | 32768 |
| maxel | mul | 64 | reference: Maxel as a map of pixels | 3.275e+07 | 3.666e+07 | |
| maxel | mul | 64 | ours: byte counts, SIMD | 4.318e+04 | 9.751e+05 | 32768 |
| maxel | mul | 256 | C int64, gcc -O3 -march=native | 2.688e+06 | 3.289e+06 | 524288 |
| maxel | mul | 256 | C u8 dot, gcc -O3 -march=native | 5.355e+05 | 2.101e+06 | 65536 |
| maxel | mul | 256 | ours: int64 kernel | 1.138e+07 | 1.12e+07 | 524288 |
| maxel | mul | 256 | ours: int64 kernel, counts ±1000 | 2.244e+07 | 2.1e+07 | 524288 |
| maxel | mul | 256 | ours: byte counts, SIMD | 1.39e+06 | 5.948e+07 | 524288 |
| maxel | mul | 512 | C int64, gcc -O3 -march=native | 2.241e+07 | 2.816e+07 | 2097152 |
| maxel | mul | 512 | C u8 dot, gcc -O3 -march=native | 4.603e+06 | 1.657e+07 | 262144 |
| maxel | mul | 512 | ours: int64 kernel | 8.402e+07 | 8.451e+07 | 2097152 |
| maxel | mul | 512 | ours: int64 kernel, counts ±1000 | 1.581e+08 | 1.613e+08 | 2097152 |
| maxel | mul | 512 | ours: byte counts, SIMD | 1.032e+07 | 4.717e+08 | 2097152 |
| mset | add | 16 | C int32 add, auto-vectorised | 4.156 | 11.57 | 64 |
| mset | add | 16 | ours: int32 counts, SIMD | 59.82 | 89.59 | 64 |
| mset | add | 16 | Raya Int32List loop | 27.64 | 45.7 | 64 |
| mset | add | 16 | Raya Map<int, int> | 513.8 | 640.5 | |
| mset | add | 16 | reference: sorted element list (Mset) | 4510 | 5183 | 144 |
| mset | add | 256 | C int32 add, auto-vectorised | 28.61 | 27.64 | 1024 |
| mset | add | 256 | ours: int32 counts, SIMD | 191.6 | 245.5 | 1024 |
| mset | add | 256 | Raya Int32List loop | 393.3 | 508.3 | 1024 |
| mset | add | 256 | Raya Map<int, int> | 8370 | 1.005e+04 | |
| mset | add | 256 | reference: sorted element list (Mset) | 1.615e+05 | 1.784e+05 | 3168 |
| mset | add | 4096 | C int32 add, auto-vectorised | 457.2 | 745.3 | 16384 |
| mset | add | 4096 | ours: int32 counts, SIMD | 1787 | 2593 | 16384 |
| mset | add | 4096 | Raya Int32List loop | 5670 | 7480 | 16384 |
| mset | add | 4096 | Raya Map<int, int> | 1.288e+05 | 1.587e+05 | |
| mset | add | 4096 | reference: sorted element list (Mset) | 3.081e+06 | 3.43e+06 | 49016 |
| mset | add | 65536 | C int32 add, auto-vectorised | 1.026e+04 | 1.173e+04 | 262144 |
| mset | add | 65536 | ours: int32 counts, SIMD | 1.163e+05 | 2.481e+05 | 262144 |
| mset | add | 65536 | Raya Int32List loop | 2.048e+05 | 3.557e+05 | 262144 |
| mset | add | 65536 | Raya Map<int, int> | 3.071e+06 | 5.286e+06 | |
| mset | union | 16 | ours: int32 counts, SIMD | 59.54 | 118.7 | 64 |
| mset | union | 256 | ours: int32 counts, SIMD | 192.8 | 934.6 | 1024 |
| mset | union | 4096 | ours: int32 counts, SIMD | 1842 | 1.375e+04 | 16384 |
| mset | union | 65536 | ours: int32 counts, SIMD | 1.274e+05 | 6.392e+05 | 262144 |
| multi | caret | 8 | ours: packed 64-bit words | 6483 | 8631 | 112 |
| multi | caret | 8 | reference: one object per element (Box) | 4.689e+04 | 5.393e+04 | |
| multi | caret | 15 | ours: packed 64-bit words | 5977 | 7921 | 112 |
| multi | caret | 15 | reference: one object per element (Box) | 5.435e+04 | 6.185e+04 | |
| multi | mul | 8 | ours: packed 64-bit words | 7763 | 9344 | 128 |
| multi | mul | 8 | reference: one object per element (Box) | 4.678e+04 | 5.606e+04 | |
| multi | mul | 15 | ours: packed 64-bit words | 2.078e+04 | 2.445e+04 | 240 |
| multi | mul | 15 | reference: one object per element (Box) | 2.527e+05 | 3.067e+05 | |
| multi | mul | 256 | ours: packed words, many terms | 3.129e+07 | 3.962e+07 | 4096 |
| multi | mul | 2048 | ours: packed words, many terms | 6.098e+08 | 8.803e+08 | 32768 |
| nat | add | 10 | Raya BigInt | 23.05 | 32.88 | 24 |
| nat | add | 10 | C int64, gcc -O3 -march=native | 0.3614 | 0.176 | 8 |
| nat | add | 10 | ours: int64 counts | 31.5 | 45.96 | 8 |
| nat | add | 10 | GMP mpz | 5.391 | 7.829 | 16 |
| nat | add | 10 | Raya int (native int64) | 1.023 | 1.296 | 8 |
| nat | add | 10 | reference: one object per element (Box) | 1024 | 1344 | |
| nat | add | 10 | tally: mset of zeros, 1 byte each | 16.69 | 41.08 | 10 |
| nat | add | 1000 | Raya BigInt | 23.45 | 32.84 | 24 |
| nat | add | 1000 | C int64, gcc -O3 -march=native | 0.3607 | 0.1751 | 8 |
| nat | add | 1000 | ours: int64 counts | 32.07 | 45.92 | 8 |
| nat | add | 1000 | GMP mpz | 5.391 | 7.82 | 16 |
| nat | add | 1000 | Raya int (native int64) | 1.027 | 1.295 | 8 |
| nat | add | 1000 | reference: one object per element (Box) | 7.485e+04 | 9.76e+04 | |
| nat | add | 1000 | tally: mset of zeros, 1 byte each | 201.4 | 197.6 | 1000 |
| nat | add | 100000 | Raya BigInt | 23.65 | 32.87 | 24 |
| nat | add | 100000 | C int64, gcc -O3 -march=native | 0.3623 | 0.176 | 8 |
| nat | add | 100000 | ours: int64 counts | 32.39 | 45.89 | 8 |
| nat | add | 100000 | GMP mpz | 5.42 | 7.838 | 16 |
| nat | add | 100000 | Raya int (native int64) | 1.027 | 1.295 | 8 |
| nat | add | 100000 | reference: one object per element (Box) | 1.278e+07 | 1.986e+07 | |
| nat | add | 100000 | tally: mset of zeros, 1 byte each | 1.881e+04 | 2.295e+04 | 100000 |
| nat | add | 10000000 | Raya BigInt | 23.64 | 32.73 | 24 |
| nat | add | 10000000 | C int64, gcc -O3 -march=native | 0.3612 | 0.1754 | 8 |
| nat | add | 10000000 | ours: int64 counts | 31.98 | 45.83 | 8 |
| nat | add | 10000000 | GMP mpz | 5.396 | 7.802 | 16 |
| nat | add | 10000000 | Raya int (native int64) | 1.014 | 1.295 | 8 |
| nat | add | 10000000 | tally: mset of zeros, 1 byte each | 6.135e+06 | 1.242e+07 | 10000000 |
| nat | mul | 10 | Raya BigInt | 23.1 | 33.31 | 24 |
| nat | mul | 10 | C int64, gcc -O3 -march=native | 0.3017 | 0.2796 | 8 |
| nat | mul | 10 | ours: int64 counts | 57.6 | 77.23 | 8 |
| nat | mul | 10 | GMP mpz | 6.313 | 8.752 | 16 |
| nat | mul | 10 | Raya int (native int64) | 1.172 | 1.619 | 8 |
| nat | mul | 10 | reference: one object per element (Box) | 1.609e+04 | 1.848e+04 | |
| nat | mul | 10 | tally: mset of zeros, 1 byte each | 120.9 | 247.4 | 10 |
| nat | mul | 1000 | Raya BigInt | 23.58 | 33.45 | 24 |
| nat | mul | 1000 | C int64, gcc -O3 -march=native | 0.3044 | 0.279 | 8 |
| nat | mul | 1000 | ours: int64 counts | 57.52 | 76.17 | 8 |
| nat | mul | 1000 | GMP mpz | 6.309 | 8.731 | 16 |
| nat | mul | 1000 | Raya int (native int64) | 1.146 | 1.619 | 8 |
| nat | mul | 1000 | tally: mset of zeros, 1 byte each | 3.406e+05 | 6.818e+05 | 1000 |
| nat | mul | 100000 | Raya BigInt | 22.9 | 31.32 | 24 |
| nat | mul | 100000 | C int64, gcc -O3 -march=native | 0.3043 | 0.2791 | 8 |
| nat | mul | 100000 | ours: int64 counts | 57.92 | 76.28 | 8 |
| nat | mul | 100000 | GMP mpz | 6.335 | 8.746 | 16 |
| nat | mul | 100000 | Raya int (native int64) | 1.169 | 1.619 | 8 |
| nat | mul | 10000000 | Raya BigInt | 23.26 | 31.33 | 24 |
| nat | mul | 10000000 | C int64, gcc -O3 -march=native | 0.3044 | 0.2788 | 8 |
| nat | mul | 10000000 | ours: int64 counts | 57.26 | 76.37 | 8 |
| nat | mul | 10000000 | GMP mpz | 6.312 | 8.75 | 16 |
| nat | mul | 10000000 | Raya int (native int64) | 1.159 | 1.62 | 8 |
| poly | add | 16 | ours: int64 counts | 227.8 | 311.6 | 136 |
| poly | add | 64 | ours: int64 counts | 807.5 | 1001 | 520 |
| poly | add | 256 | ours: int64 counts | 3058 | 4020 | 2056 |
| poly | add | 1024 | ours: int64 counts | 1.226e+04 | 1.522e+04 | 8200 |
| poly | add | 4096 | ours: int64 counts | 4.822e+04 | 6.213e+04 | 32776 |
| poly | mul | 16 | ours: automatic choice | 515 | 750.8 | 136 |
| poly | mul | 16 | C int64, gcc -O3 -march=native | 141 | 148.1 | 136 |
| poly | mul | 16 | GMP Kronecker (bit packing) | 795.5 | 1267 | 136 |
| poly | mul | 16 | GMP Kronecker (mpz_import) | 779.4 | 1015 | 136 |
| poly | mul | 16 | ours: int64 kernel | 499.4 | 743.8 | 136 |
| poly | mul | 16 | Raya BigInt, Kronecker | 4.609e+04 | 4.577e+04 | 136 |
| poly | mul | 16 | reference: sorted element list (Mset) | 7.109e+08 | 9.06e+08 | 20920 |
| poly | mul | 16 | reference: Polynumber over Q | 2.59e+05 | 3.444e+05 | |
| poly | mul | 16 | Raya BigInt, schoolbook | 1.56e+04 | 1.972e+04 | 136 |
| poly | mul | 16 | ours: byte counts, SIMD | 1154 | 4563 | 136 |
| poly | mul | 64 | ours: automatic choice | 2930 | 7568 | 520 |
| poly | mul | 64 | C int64, gcc -O3 -march=native | 1071 | 1157 | 520 |
| poly | mul | 64 | GMP Kronecker (bit packing) | 4900 | 8402 | 520 |
| poly | mul | 64 | GMP Kronecker (mpz_import) | 3201 | 3915 | 520 |
| poly | mul | 64 | ours: int64 kernel | 5890 | 7558 | 520 |
| poly | mul | 64 | Raya BigInt, Kronecker | 1.677e+05 | 1.604e+05 | 520 |
| poly | mul | 64 | reference: Polynumber over Q | 3.977e+06 | 4.901e+06 | |
| poly | mul | 64 | Raya BigInt, schoolbook | 2.114e+05 | 2.541e+05 | 520 |
| poly | mul | 64 | ours: byte counts, SIMD | 2856 | 2.487e+04 | 520 |
| poly | mul | 256 | ours: automatic choice | 1.223e+04 | 1.127e+05 | 2056 |
| poly | mul | 256 | C int64, gcc -O3 -march=native | 1.605e+04 | 1.955e+04 | 2056 |
| poly | mul | 256 | GMP Kronecker (bit packing) | 4.919e+04 | 1.132e+05 | 2056 |
| poly | mul | 256 | GMP Kronecker (mpz_import) | 1.894e+04 | 2.333e+04 | 2056 |
| poly | mul | 256 | ours: int64 kernel | 9.854e+04 | 1.126e+05 | 2056 |
| poly | mul | 256 | Raya BigInt, Kronecker | 7.326e+05 | 7.429e+05 | 2056 |
| poly | mul | 256 | reference: Polynumber over Q | 6.382e+07 | 8.029e+07 | |
| poly | mul | 256 | Raya BigInt, schoolbook | 3.539e+06 | 4.147e+06 | 2056 |
| poly | mul | 256 | ours: byte counts, SIMD | 1.225e+04 | 2.716e+05 | 2056 |
| poly | mul | 1024 | ours: automatic choice | 8.427e+04 | 1.72e+06 | 8200 |
| poly | mul | 1024 | C int64, gcc -O3 -march=native | 2.518e+05 | 3.197e+05 | 8200 |
| poly | mul | 1024 | GMP Kronecker (bit packing) | 6.99e+05 | 1.686e+06 | 8200 |
| poly | mul | 1024 | GMP Kronecker (mpz_import) | 9.708e+04 | 1.161e+05 | 8200 |
| poly | mul | 1024 | ours: int64 kernel | 1.413e+06 | 1.72e+06 | 8200 |
| poly | mul | 1024 | Raya BigInt, Kronecker | 2.998e+06 | 2.99e+06 | 8200 |
| poly | mul | 1024 | Raya BigInt, schoolbook | 5.018e+07 | 5.968e+07 | 8200 |
| poly | mul | 1024 | ours: byte counts, SIMD | 8.726e+04 | 3.879e+06 | 8200 |
| poly | mul | 4096 | ours: automatic choice | 9.537e+05 | 2.716e+07 | 32776 |
| poly | mul | 4096 | C int64, gcc -O3 -march=native | 4.271e+06 | 6.137e+06 | 32776 |
| poly | mul | 4096 | GMP Kronecker (bit packing) | 1.054e+07 | 2.706e+07 | 32776 |
| poly | mul | 4096 | GMP Kronecker (mpz_import) | 5.419e+05 | 6.091e+05 | 32776 |
| poly | mul | 4096 | ours: int64 kernel | 2.209e+07 | 2.713e+07 | 32776 |
| poly | mul | 4096 | Raya BigInt, Kronecker | 1.663e+07 | 1.935e+07 | 32776 |
| poly | mul | 4096 | ours: byte counts, SIMD | 9.566e+05 | 5.549e+07 | 32776 |
| polybig | add | 16 | ours: int64 counts | 228.9 | 310 | 136 |
| polybig | add | 64 | ours: int64 counts | 802 | 1035 | 520 |
| polybig | add | 256 | ours: int64 counts | 3038 | 3963 | 2056 |
| polybig | add | 1024 | ours: int64 counts | 1.216e+04 | 1.578e+04 | 8200 |
| polybig | mul | 16 | ours: automatic choice | 1.541e+04 | 1.97e+04 | 136 |
| polybig | mul | 16 | GMP Kronecker (bit packing) | 1487 | 2456 | 136 |
| polybig | mul | 16 | GMP Kronecker (mpz_import) | 2080 | 2712 | 136 |
| polybig | mul | 16 | Raya BigInt, Kronecker | 1.115e+05 | 1.159e+05 | 136 |
| polybig | mul | 16 | reference: Polynumber over Q | 2.503e+05 | 3.33e+05 | |
| polybig | mul | 16 | Raya BigInt, schoolbook | 1.498e+04 | 1.971e+04 | 136 |
| polybig | mul | 64 | ours: automatic choice | 2.199e+05 | 2.726e+05 | 520 |
| polybig | mul | 64 | GMP Kronecker (bit packing) | 1.338e+04 | 2.603e+04 | 520 |
| polybig | mul | 64 | GMP Kronecker (mpz_import) | 1.017e+04 | 1.224e+04 | 520 |
| polybig | mul | 64 | Raya BigInt, Kronecker | 4.236e+05 | 4.473e+05 | 520 |
| polybig | mul | 64 | reference: Polynumber over Q | 3.705e+06 | 4.807e+06 | |
| polybig | mul | 64 | Raya BigInt, schoolbook | 2.146e+05 | 2.732e+05 | 520 |
| polybig | mul | 256 | ours: automatic choice | 1.785e+06 | 1.914e+06 | 2056 |
| polybig | mul | 256 | GMP Kronecker (bit packing) | 1.579e+05 | 3.656e+05 | 2056 |
| polybig | mul | 256 | GMP Kronecker (mpz_import) | 5.956e+04 | 7.063e+04 | 2056 |
| polybig | mul | 256 | Raya BigInt, Kronecker | 1.804e+06 | 1.914e+06 | 2056 |
| polybig | mul | 256 | reference: Polynumber over Q | 5.497e+07 | 7.574e+07 | |
| polybig | mul | 256 | Raya BigInt, schoolbook | 3.511e+06 | 4.374e+06 | 2056 |
| polybig | mul | 1024 | ours: automatic choice | 9.059e+06 | 1.061e+07 | 8200 |
| polybig | mul | 1024 | GMP Kronecker (bit packing) | 2.184e+06 | 5.389e+06 | 8200 |
| polybig | mul | 1024 | GMP Kronecker (mpz_import) | 3.347e+05 | 3.747e+05 | 8200 |
| polybig | mul | 1024 | Raya BigInt, Kronecker | 9.169e+06 | 1.065e+07 | 8200 |
| polybig | mul | 1024 | Raya BigInt, schoolbook | 5.3e+07 | 6.494e+07 | 8200 |
| rat | add | 8 | double (inexact) | 1.925 | 1.621 | 8 |
| rat | add | 8 | GMP mpq | 77.72 | 103.5 | 32 |
| rat | add | 8 | ours: Rat64 value class | 99.74 | 133.5 | 16 |
| rat | add | 8 | Raya Rational over BigInt | 834.8 | 1061 | |
| rat | add | 16 | double (inexact) | 1.925 | 1.619 | 8 |
| rat | add | 16 | GMP mpq | 85.56 | 119.2 | 32 |
| rat | add | 16 | ours: Rat64 value class | 203.5 | 246.5 | 16 |
| rat | add | 16 | Raya Rational over BigInt | 1476 | 1889 | |
| rat | add | 30 | double (inexact) | 1.925 | 1.622 | 8 |
| rat | add | 30 | GMP mpq | 102.6 | 146.4 | 32 |
| rat | add | 30 | ours: Rat64 value class | 365.4 | 445.2 | 16 |
| rat | add | 30 | Raya Rational over BigInt | 2812 | 3591 | |
| rat | add | 40 | double (inexact) | 1.925 | 1.622 | 8 |
| rat | add | 40 | GMP mpq | 114.4 | 168.9 | 32 |
| rat | add | 40 | Raya Rational over BigInt | 3931 | 5106 | |
| rat | mul | 8 | double (inexact) | 1.925 | 1.945 | 8 |
| rat | mul | 8 | GMP mpq | 96.48 | 125.6 | 32 |
| rat | mul | 8 | ours: Rat64 value class | 111 | 156.2 | 16 |
| rat | mul | 8 | Raya Rational over BigInt | 1494 | 2037 | |
| rat | mul | 16 | double (inexact) | 1.925 | 1.943 | 8 |
| rat | mul | 16 | GMP mpq | 113.8 | 158.8 | 32 |
| rat | mul | 16 | ours: Rat64 value class | 226.8 | 283.7 | 16 |
| rat | mul | 16 | Raya Rational over BigInt | 2190 | 2944 | |
| rat | mul | 30 | double (inexact) | 1.926 | 1.943 | 8 |
| rat | mul | 30 | GMP mpq | 145.9 | 217.4 | 32 |
| rat | mul | 30 | ours: Rat64 value class | 392.8 | 480.9 | 16 |
| rat | mul | 30 | Raya Rational over BigInt | 3312 | 4338 | |
| rat | mul | 40 | double (inexact) | 1.925 | 1.947 | 8 |
| rat | mul | 40 | GMP mpq | 168.4 | 258 | 32 |
| rat | mul | 40 | Raya Rational over BigInt | 4458 | 5876 | |
| rat | overflow | 40 | ours: Rat64 value class | — | — | |
| vexmul | mul | 256 | Raya BigInt | 52.56 | 62.67 | 32 |
| vexmul | mul | 256 | Raya BigInt fastMultiply | 60.87 | 71.52 | 32 |
| vexmul | mul | 256 | GMP mpz | 25.97 | 24.07 | 32 |
| vexmul | mul | 256 | ours: vexel base 2¹⁶ | 956.1 | 1294 | 128 |
| vexmul | mul | 256 | ours: vexel base 2⁸, SIMD | 2537 | 3367 | 256 |
| vexmul | mul | 1024 | Raya BigInt | 413.2 | 418.2 | 128 |
| vexmul | mul | 1024 | Raya BigInt fastMultiply | 424.7 | 429.1 | 128 |
| vexmul | mul | 1024 | GMP mpz | 208.8 | 200.5 | 128 |
| vexmul | mul | 1024 | ours: vexel base 2¹⁶ | 8276 | 9934 | 512 |
| vexmul | mul | 1024 | ours: vexel base 2⁸, SIMD | 9087 | 3.401e+04 | 1024 |
| vexmul | mul | 4096 | Raya BigInt | 5432 | 5166 | 512 |
| vexmul | mul | 4096 | Raya BigInt fastMultiply | 5456 | 5179 | 512 |
| vexmul | mul | 4096 | GMP mpz | 2112 | 2007 | 512 |
| vexmul | mul | 4096 | ours: vexel base 2¹⁶ | 9.395e+04 | 1.21e+05 | 2048 |
| vexmul | mul | 4096 | ours: vexel base 2⁸, SIMD | 4.283e+04 | 4.528e+05 | 4096 |
| vexmul | mul | 16384 | Raya BigInt | 8.368e+04 | 8.122e+04 | 2048 |
| vexmul | mul | 16384 | Raya BigInt fastMultiply | 6.339e+04 | 7.202e+04 | 2048 |
| vexmul | mul | 16384 | GMP mpz | 1.79e+04 | 1.792e+04 | 2048 |
| vexmul | mul | 16384 | ours: vexel base 2¹⁶ | 1.428e+06 | 1.77e+06 | 8192 |
| vexmul | mul | 16384 | ours: vexel base 2⁸, SIMD | 3.211e+05 | 6.912e+06 | 16384 |
| vexmul | mul | 65536 | Raya BigInt | 1.334e+06 | 1.182e+06 | 8192 |
| vexmul | mul | 65536 | Raya BigInt fastMultiply | 6.001e+05 | 5.655e+05 | 8192 |
| vexmul | mul | 65536 | GMP mpz | 1.256e+05 | 1.242e+05 | 8192 |
| vexmul | mul | 65536 | ours: vexel base 2¹⁶ | 2.235e+07 | 2.574e+07 | 32768 |
| vexmul | mul | 65536 | ours: vexel base 2⁸, SIMD | 3.999e+06 | 1.025e+08 | 65536 |
| vexsum | sum | 16 | Raya BigInt | 35.05 | 45.37 | |
| vexsum | sum | 16 | GMP mpz | 12.38 | 14.21 | 128 |
| vexsum | sum | 16 | ours: vexel base 2¹⁶, one carry | 132.8 | 190.4 | |
| vexsum | sum | 256 | Raya BigInt | 38.23 | 46.75 | |
| vexsum | sum | 256 | GMP mpz | 15.14 | 16.59 | 128 |
| vexsum | sum | 256 | ours: vexel base 2¹⁶, one carry | 68.85 | 95.51 | |
| vexsum | sum | 4096 | Raya BigInt | 36.65 | 48.74 | |
| vexsum | sum | 4096 | GMP mpz | 15.38 | 17.31 | 128 |
| vexsum | sum | 4096 | ours: vexel base 2¹⁶, one carry | 65.19 | 92.05 |
What is worth making first-class in Raya
- **Polynumber counts (
PolyMset).** The clearest win: exact polynomial arithmetic that beats C's scalar loop and GMP between degree about 256 and 1,024 on Graviton (C is faster below about 128, GMP above about 2,000), with automatic widening from int64 toBigInt. Bipolynumbers and vexel products reuse it. Next step: a subquadratic multiplication layer on top, to stay ahead of GMP past degree 2,000. - **Small exact rationals (
Rat64).** 8 times faster than the BigInt rational, and the generated value-class equality is rational equality. Making it first-class needs compiler support for a small/large split (a value class cannot hold aBigInttoday, the wayintandBigIntare split), plus one more integer intrinsic. - **Checked count arrays for msets and maxels (
CountMset,DenseMaxel).** Counts that widen instead of overflowing, with SIMD products for small counts. The measured gap to C says two compiler items would pay off more than the types themselves: an integer auto-vectoriser (today it vectorises float loops only), and SIMD lowering on x86. - **Packed monomial words (
PackedPoly,Multinumber).** The standard fast layout for polynomials in many variables; it belongs in a computer-algebra library. - **Hash-consed boxes (
BoxPool)** stay a library: they make nested boxes usable at real sizes, but they are slower for tiny boxes.
Not worth it: tallies (unary naturals) and base-2ᵏ vexels as number types. In both cases int and BigInt are already the compressed, faster form.
Sources
- N J Wildberger, Math Foundations lectures 1 to 238 and Algebraic Calculus One, YouTube. The 44 lectures used, in date order:
- 29 January 2009 · What is a number? · Math Foundations 1
- 30 January 2009 · Arithmetic with numbers · Math Foundations 2
- 3 February 2009 · Laws of Arithmetic · Math Foundations 3
- 16 February 2009 · Fractions · Math Foundations 9
- 16 February 2009 · Arithmetic with fractions · Math Foundations 10
- 10 March 2009 · Introducing the integers · Math Foundations 12
- 10 March 2009 · Rational numbers · Math Foundations 13
- 18 March 2009 · Extremely big numbers · Math Foundations 17
- 3 May 2010 · Polynomials and polynumbers · Math Foundations 57
- 6 May 2010 · Arithmetic with positive polynumbers · Math Foundations 58
- 17 May 2010 · What exactly is a polynomial? · Math Foundations 60
- 16 November 2010 · Arithmetic with integral polynumbers · Math Foundations 62
- 29 December 2011 · Row and column polynumbers · Math Foundations 65
- 1 January 2012 · Laurent polynumbers (the New Years Day lecture) · Math Foundations 68
- 9 August 2015 · Fun with lists, ordered sets, multisets I · Math Foundations 152
- 16 August 2015 · Fun with lists, multisets + sets II · Math Foundations 153
- 23 August 2015 · Fun with lists, multisets and sets III · Math Foundations 154
- 7 September 2015 · The realm of natural number multisets · Math Foundations 156
- 13 September 2015 · The algebra of natural number multisets · Math Foundations 157
- 29 December 2015 · Fun with lists, multisets and sets IV · Math Foundations 161
- 7 February 2016 · Maxel theory: new thinking about matrices I · Math Foundations 166
- 21 February 2016 · Maxel algebra! I · Math Foundations 169
- 5 March 2016 · Singletons, vexels, and the rank of a maxel I · Math Foundations 171
- 19 March 2016 · A disruptive view of big number arithmetic · Math Foundations 173
- 18 June 2016 · Multisets and a new framework for arithmetic · Math Foundations 187
- 9 July 2016 · Numbers, polynumbers and arithmetic with vexels I · Math Foundations 190
- 16 July 2016 · Numbers, polynumbers, and arithmetic with vexels II · Math Foundations 191
- 24 July 2016 · Arithmetic with base 2 vexels · Math Foundations 192
- 22 October 2016 · Negative numbers, msets, and modern physics · Math Foundations 205
- 29 October 2016 · A new trichotomy to set up integers · Math Foundations 206
- 5 November 2016 · Integral vectors and matrices via vexels and maxels I · Math Foundations 207
- 26 November 2016 · A broad canvas: algebra with maxels from integers · Math Foundations 209
- 18 December 2016 · The anti operation in mathematics · Math Foundations 212
- 9 December 2017 · Vexels and Polynumbers via Multisets · Algebraic Calculus One
- 17 February 2018 · Bi Polynumbers and Tangents to Algebraic Curves · Algebraic Calculus One
- 17 December 2022 · A multiset approach to arithmetic · Math Foundations 227
- 25 December 2022 · The big step from polynumbers to multinumbers!! · Math Foundations 228
- 31 December 2022 · The operation of caret / exponentiation (new!) via multisets · Math Foundations 229
- 8 January 2023 · Multiset arithmetic via trees · Math Foundations 230
- 30 January 2023 · Negatives numbers from anti msets · Math Foundations 231
- 14 March 2023 · More arithmetic with negative msets · Math Foundations 232
- 13 August 2023 · Towards a New Arithmetic !!! with msets / boxes · Math Foundations 226
- 3 September 2023 · Introducing (finally!) Box Arithmetic · Math Foundations 237
- 15 October 2023 · Box Arithmetic with Polynumbers · Math Foundations 238
- Measurements: 30 November 2026, Raya 0.4.0, C (gcc -O3 -march=native) and GMP 6.3 on Ubuntu 24.04.
Working with Riptide
Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.
Method details
- Hardware. Arm: AWS Graviton3 (Neoverse-V1); one point (boxes of naturals, n = 1,000) ran on a Graviton2. x86: Intel Xeon Platinum 8259CL and 8175M. Linux.
- Software. Raya 0.4.0, compiled ahead of time (
raya compile exe). Baselines: C compiled with gcc -O3 -march=native, and GMP 6.3, on Ubuntu 24.04. - Timing. Single thread. Each time is the best of 5 blocks of at least 60 ms, reported per operation. Every row is checked against a second implementation before it is timed.
- Runs. Each type and size ran in its own fresh 2-vCPU container on both architectures, plus reruns; 593 rows in all.