# The budgets that `tests/speed.rs` checks. Each section starts with an item type in brackets. Each line under it holds a function's name and its two native budgets at that type, separated by tabs: first for macOS on Apple silicon, where matrix products and decompositions run on Accelerate, then for Linux on CI's x86 runner, where they run on rustymath's own kernels. `rustymath::timing::NATIVE_COLUMN` picks the budget a machine checks. A budget counts copies of as many items as the function's inputs hold, or its output for broadcasting.
# An initial budget is twice what a first-principles analysis says the function should cost, and at least 0.5. A later budget comes from a fuller understanding of the function than that analysis gives, such as a platform difference or a cost the analysis missed. A comment above each function, or above its group, gives the expected cost and its reason, as in "1 copy: one read and one write per item", and records each later change with its reason. `basedpl.bpltests.set_budgets` writes budgets from expected costs.
# One expected cost serves both platforms at first. A platform's budget differs only where a specific difference on that platform is found, such as Accelerate's matrix products on macOS.
# A function that costs more than its budget needs study, which finds either a speed bug to fix or something the analysis missed. Avoid raising a budget to match a run without understanding why the function costs what it does.
# CI's x86 runner is an AMD Ryzen 9 7950X3D 16-Core Processor.
# The macOS budgets come from an Apple M5 Max. On 23 October 2026 it measured Accelerate's rates for four classes of product, in flops in the time of a copy of the same item type, with real flops in a complex copy's time. A case whose product runs far from its class's rate gives its own measured rate.
# - Large square products: 58 at f64 and 117 at f32 for 1024×1024 matrices, and 110 and 189 for complex ones. 42 and 48 for 128×128 matrices, and 90 and 137 for complex ones.
# - Rank-k updates, products whose shared dimension is short, as blocked factorizations make: about 30 at f64 and f32 for rank-32 updates of 256×256 matrices, and 53 and 60 for complex 128×128 ones.
# - Matrix-vector products: about 7 at f64 and 5 at f32 for a 256×256 matrix, and 29 and 18 for a complex 128×128 one.
# - Tall thin Gram products, a tall matrix's transpose times the matrix: about 7 at f64 and 4 at f32 for a 4096×16 matrix.
[f64]
# 7 copies, for 28 vector ops: clamp, reduction by ln 2, a degree-9 polynomial, scaling by 2^n.
Exp	14	14
# 8.5 copies, for 34 vector ops: exp's steps with a longer polynomial near 0.
Expm1	17	17
# 6.5 copies, for 26 vector ops: a test for each block of 16 items that every item is positive, normal and finite, then the split into mantissa and exponent, one division, a series in s² and the combine. A block of 16 items that holds a zero, a negative, a subnormal, an infinity or NaN takes the full form with its special values, which costs about 1.9 times as much on macOS.
Ln	13	13
# 10 copies, for 40 vector ops: ln's steps plus the correction for 1 + x, with the block test on 1 + x and on whether x is 0. A block of 16 items that holds a zero, a negative, a subnormal, an infinity or NaN takes the full form with its special values, which costs about 1.6 times as much on macOS.
Log1p	20	20
# 6.5 copies, for 26 vector ops: ln's steps with a scaled combine.
Log2	13	13
# 6.5 copies, for 26 vector ops: ln's steps with a scaled combine.
Log10	13	13
# 6.5 copies, for 26 vector ops: reduction by π/2, a polynomial, the quadrant.
Sin	13	13
# 7 copies, for 28 vector ops: sin's steps with a shifted quadrant.
Cos	14	14
# 8 copies, for 32 vector ops: reduction, a polynomial, a division.
Tan	16	16
# 7.5 copies, for 30 vector ops: a square root past 1/2, a polynomial, selects.
Asin	15	15
# 8 copies, for 32 vector ops: asin's steps and a reflection.
Acos	16	16
# 7 copies, for 28 vector ops: a reduction by division, a polynomial, selects.
Atan	14	14
# 10 copies, for 40 vector ops: expm1, a division, selects.
Sinh	20	20
# 8 copies, for 32 vector ops: exp and its reciprocal.
Cosh	16	16
# 10 copies, for 40 vector ops: expm1 and a division.
Tanh	20	20
# 11.5 copies, for 46 vector ops: ln, a square root, selects.
Asinh	23	23
# 11.5 copies, for 46 vector ops: ln and a square root.
Acosh	23	23
# 10.5 copies, for 42 vector ops: log1p of a quotient.
Atanh	21	21
# 9 copies, for 36 vector ops: split, a polynomial, two Newton steps with divisions.
Cbrt	18	18
# 27.5 copies, for 110 vector ops: double-word ln and exp, special cases.
Pow	55	55
# 55 copies, for Pow's 110 ops as scalar code, pair by pair, at half a copy each.
Pow.one	110	110
# 4 copies, for 16 vector ops: scaling, a square root, a division; two reads and a write take 1.5.
Hypot	8	8
# 28 copies, for Pow's steps with a reciprocal power.
Root	56	56
# 55 copies, for Root as scalar code, pair by pair.
Root.one	110	110
# 1.5 copies, for two reads and one write per item.
Maximum	3	3
# 0.5 copies, for one read per item.
reduce::sum	1	1
# 0.5 copies, for one read per item.
reduce::max	1	1
# 1 copies, for one read and one write per item; the scan runs in vector steps.
reduce::cumsum	2	2
# 1 copies, for one read and one write per item; the scan runs in vector steps.
reduce::cummax	2	2
# 2.75 copies, for a read and a write (1) and 7 FMAs (1.75). It was 3.75 while `evaluate` worked in place, which its callers paid for with a copy of the input.
polynomial::evaluate	5.5	5.5
# 132 copies, for 530 vector ops: a double-word Lanczos sum and quotient, double-word ln of the exponent, exp_plus, sinpi for the reflection.
Gamma	270	270
# 54 copies, for 215 vector ops: a plain Lanczos sum, double-word ln, ln_split, sinpi.
Lgamma	110	110
# 32 copies, for 130 vector ops: every piece of the piecewise rational, selected per lane.
Erf	64	64
# 32 copies, for 130 vector ops: rational pieces with divisions, a double-word -a², exp_plus.
Erfc	64	64
# 20 copies, for 80 vector ops: piecewise rationals, ln and a square root in the tails.
Erfinv	40	40
# 21 copies, for 85 vector ops: as erfinv, from 1 - q.
Erfcinv	42	42
# 450 copies, for 900 scalar ops: a double-word prefactor (300) and about 50 series or continued-fraction steps of 12 ops, at half a copy each.
Gammainc	900	900
# 450 copies, for Gammainc's 900 scalar ops.
Gammaincc	900	900
# 1800 copies, for about four evaluations of Gammainc and its derivative, 3,600 scalar ops.
Gammaincinv	3600	3600
# 1200 copies, for 2,400 scalar ops: a double-word prefactor of two ln and three lgamma (1,500) and about 60 continued-fraction steps of 15 ops.
Betainc	2400	2400
# 4800 copies, for about four evaluations of Betainc.
Betaincinv	9600	9600
# 10 copies, for 78 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: exp of the real part and sin and cos of the imaginary part. The count leaves out `split`'s passes over the parts and the results. It costs about 16.5 copies on macOS. CI measured about 24 copies on 22 October, before `exp_parts` stopped calling `quarter` for every item. CI's earlier runs showed 8 to 11 copies only because each divided by a copy read from memory. After that change CI measured 19.1, about twice its expected cost, where a budget of twice it would fail by chance, so its Linux budget stays held.
complex Exp	20	43
# 12.5 copies, for 100 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot, ln with care near |z| = 1, atan2. It costs about 30 copies on macOS and 32.4 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Ln	63	61
# 4.5 copies, for 36 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot, a square root, a division, selects. It costs 10.2 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS it costs about 8.6 copies. Its slice form calls the scalar `sqrt` for each item, which also scales each item against underflow. On 23 October 2026, running it through `split!` and `sqrt_parts`, as `Sqrt1mx2` does, cost 10% more at f64 and 65% more at f32.
complex Sqrt	9	21
# 16 copies, for 126 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: sin, cos, sinh and cosh.
complex Sin	32	32
# 17.5 copies, for 140 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: sin, cos, sinh, cosh and a division.
complex Tan	35	35
# 22.5 copies, for 180 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex square root of 1 - z², a complex ln, products. It costs 42.5 copies on CI on 22 October 2026, about twice that, where a budget of twice it would fail by chance, so its Linux budget is unchanged until the cost is studied.
complex Asin	45	94
# 16 copies, for 130 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex ln of a quotient. It costs 31.1 copies on CI on 22 October 2026, about twice that, where a budget of twice it would fail by chance, so its Linux budget is unchanged until the cost is studied.
complex Atanh	32	66
# 52 copies, for 420 f64 ops per complex item: a complex Lanczos sum with 13 complex divisions, a complex ln. It costs 167 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied.
complex Lgamma	110	350
# 62 copies, for 500 f64 ops: complex Lgamma and a complex exp. It costs about 134.3 copies on macOS and 217 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Gamma	280	480
# 2 copies, for 16 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot; reading two floats and writing one take 0.75.
complex Abs	4	4
# 11.5 copies, for 92 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: two complex square roots, each a hypot pass and then one pass that writes both parts, then a product and a rebalance. It costs about 23.8 copies on macOS since `sqrt_parts` became one pass on 23 October 2026 (25.8 before), and 29.3 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Sqrt1mx2	53	62
# 23 copies, for 184 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex ln, a complex product, a complex exp. It costs about 50.6 copies on macOS and 55.3 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Pow	110	130
# 64 copies, for 256 FMAs per result item, a quarter copy each, on rustymath's own kernels. On macOS, 8.8 copies, for the same 512 flops at Accelerate's rate for a 1024×1024 product.
linalg::PlusTimes	18	130
# 128 copies, for 256 steps of a max and an add per result item, a quarter copy per op.
linalg::MaxPlus	260	260
# 128 copies, for 256 steps of a min and an add per result item, a quarter copy per op.
linalg::MinPlus	260	260
# 128 copies, for 256 steps of a comparison and an add per result item, a quarter copy per op.
linalg::PlusEqual	260	260
# 68 copies: these values fit f64 products exactly, whose 256 multiply-adds per result item take 64 at a quarter copy each on rustymath's own kernels, with passes that find the operands' largest magnitudes, 1, convert both to f64, 2, and convert the result back, 1. On macOS, 13 copies, with Accelerate's product at its rate for a 1024×1024 product, 8.8, and the same passes.
linalg::PlusTimes at i64	26	140
# 128 copies, for 256 steps of an integer comparison and an add per result item.
linalg::PlusEqual at i64	260	260
# 40 copies, for an unstable comparison sort of each 256-item row's keys, computed once: about 8 compare-and-swap levels per item at about 5 copies a level, the standard library sort's cost on random keys, which its cost at 32,768 items agrees with, plus a pass that computes the keys and one that writes the floats back. A sorting network on explicit vectors would cost about 12 to 20 by instruction counts, unmeasured, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 41 copies on macOS, down from about 80 when each comparison computed two keys.
search::view_sort_along	80	80
# 60 copies, for an unstable comparison sort of each 32,768-item lane's keys: about 15 levels per item at about 4 copies a level. A radix sort of the keys costs about 71, at about 9 copies for each of its 8 passes. A sorting network would gain here only as the base case of a long sort, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 60 copies on macOS, down from about 105 when each comparison computed two keys.
search::view_sort_along long lanes	120	120
# 15 copies, for a quickselect of each row's keys: about 3 comparisons per item at about 5 copies each, as the sorts measure comparisons, plus a pass that computes the keys and one that writes the floats back. A vectorized kernel that partitions would cost less, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 15 copies on macOS, down from about 17 when each comparison computed two keys. CI measured 12.4 on 22 October 2026, so its Linux budget follows the same expected cost.
search::view_partition_along	30	30
# 15 copies, for selecting the two middle keys of each row, which costs about what one partition does. It costs about 15 copies on macOS, down from about 33 when each comparison computed two keys. CI measured 12.6 on 22 October 2026, so its Linux budget follows the same expected cost.
search::view_quantiles_along	30	30
# 1.5 copies, for two reads per item, for the mean and the squares, and two ops.
stats::variance	3	3
# 1.5 copies, for reading the data and the weights once, with a multiply-add per item. It costs about 5.8 copies on macOS, because each chunk gathers the data and the weights into buffers, and a second pass gathers the weights again for their total. Two other methods measured slower on 21 October 2026: folding pairs of products and weights in one walk cost 6.9, because a buffer of pairs folds more slowly than the walk it saves, and reading each 64-item row in place cost 8.7, because each in-place read works out its row's offset with divisions and each row's fold pays its own setup. Reading the runs in place without copying them only ties with the gather at 64 items. A fold that sums each run straight into its output's accumulator, with no product buffer, would reach the expected cost, as step 4 in basedpl's `meta/next-phases.md` records. Both budgets stay held until then.
stats::average	74	330
# 22 copies, for 2n³/3 flops per n² items, as FMAs, plus the solve, at a quarter copy per FMA on rustymath's own kernels. It costs 44 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 10 copies: the copy into column order and the row swaps, 2.5, the products' 155 flops an item at Accelerate's rate for rank-32 updates, 5.2, and the 16-column leaves' 16 flops an item at the matrix-vector rate, 2.3. It costs 23.7 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::Lu::solve	53	110
# 64 copies, for 2n³ flops per n² items, at a quarter copy per FMA on rustymath's own kernels. CI measured 107 on 22 October 2026, so its Linux budget follows the expected cost. On macOS, 23 copies: the LU as `linalg::Lu::solve` gives it, 10, then the two triangular solves from the permuted identity, which skip no zeros, 512 flops an item at Accelerate's rate for 128×128 products, 12, and writing the inverse, 1. It costs 43 copies on macOS on 23 October 2026, about twice that, where a budget of twice it would fail by chance, so its macOS budget is unchanged until the cost is studied.
linalg::Lu::inverse	89	130
# 11 copies, for n³/3 flops per n² items, at a quarter copy per FMA on rustymath's own kernels. It costs 23.2 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 4.8 copies: the copy in and the copy closed up, 2, and its n³/3 flops at Accelerate's rate for rank-32 updates, 2.8. It costs 10.8 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::cholesky	28	56
# 85 copies, for 8n³/3 flops per n² items, 4n³/3 to factor and 4n³/3 to form Q, at a quarter copy per FMA on rustymath's own kernels. It costs 163 copies on CI on 22 October 2026, about twice that, where a budget of twice it would fail by chance, so its Linux budget is unchanged until the cost is studied. On macOS, 25 copies: the working copy and the writes of Q and R, 2, and those flops at Accelerate's rate for rank-32 updates, 23. It costs 48.8 copies on macOS on 23 October 2026, about twice that, where a budget of twice it would fail by chance, so its macOS budget is unchanged until the cost is studied.
linalg::qr	130	490
# 384 copies, for about 12n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 868 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 143 copies, for Accelerate's GESDD: half the 8n³/3 flops of its bidiagonal reduction, which run as matrix-vector products, at the matrix-vector rate, 49, the rest of its 12n³ flops at the rate for rank-32 updates, 91, and three copies in and out. It costs 473 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::svd	970	2000
# 288 copies, for about 9n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 729 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 85 copies, for Accelerate's SYEVD: half the 4n³/3 flops of its tridiagonal reduction, which run as symmetric matrix-vector products that use each item they read twice, at twice the matrix-vector rate, 12, the rest of its 9n³ flops at the rate for rank-32 updates, 71, and two copies. It costs 318 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eigh	660	1300
# 800 copies, for about 25n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 2840 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 234 copies, for Accelerate's GEEV: the 2n³/3 flops of its Hessenberg reduction that run as matrix-vector products, at the matrix-vector rate, 25, the rest of its 25n³ flops at the rate for rank-32 updates, 208, and two copies. It costs 1813 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eig	3600	5100
# 320 copies, for about 10n³ flops per n² items, at a quarter copy per FMA on rustymath's own kernels. It costs 1486 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 105 copies, for GEEV without vectors: the same matrix-vector part, 25, the rest of its 10n³ flops at the rate for rank-32 updates, 80, and one copy. It costs 1176 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eigenvalues	2400	2700
# 5 copies, for 2mn² flops on 4096×16 (32 per item) and reading the matrix, at a quarter copy per FMA on rustymath's own kernels. On CI's x86 runner it cost 35.4 copies on 22 October 2026, through CholeskyQR2, which then took this size on rustymath's own kernels. Earlier runs put Householder there about 1.5 times faster, and `tall_for_qr` now gives this size to Householder wherever Accelerate doesn't run. Householder's reflections are matrix-vector passes, far below the FMA rate this analysis assumes: on the Mac's own kernels, f64 costs about 32 copies. Through Householder, CI measured 29.5 later that day. Its Linux budget is unchanged until Householder's expected cost is worked out. On macOS, 12 copies, through CholeskyQR2: its two Gram matrices, 32 flops an item each, at Accelerate's rate for a 4096×16 matrix's transpose times the matrix, 4.8 each, the solve with R, 16 flops an item at about 16 flops in a copy's time, which Accelerate measured for a 4096×16 matrix times a 16×16 one, half its rank-k rate, 1, a copy of the matrix, 1, and the reduction of the right side, 0.5.
linalg::lstsq	24	68
# 21 copies, for 8n³/3 real flops per n² complex items, two floats per complex copy, at a quarter copy per FMA on rustymath's own kernels. It costs 61.9 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 9.3 copies: the copy into column order and the row swaps, 1.9, the products' 277 real flops an item at Accelerate's rate for complex rank-32 updates, 5.2, and the leaves' 64 at the complex matrix-vector rate, 2.2. It costs 29 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::Lu::solve	58	100
# 85 copies, for 32n³/3 real flops per n² complex items, half to factor and half to form Q, at a quarter copy per FMA on rustymath's own kernels. It costs 281 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 28 copies: the working copy and the writes, 2, and those flops at Accelerate's rate for complex rank-32 updates, 26. It costs 72.5 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::qr	180	510
# 384 copies, for about 48n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. It costs 846 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 130 copies, for Accelerate's GESDD: the 16n³/3 real flops of its bidiagonal reduction that run as matrix-vector products, at the complex matrix-vector rate, 24, the rest of its 48n³ at the rate for complex rank-32 updates, 103, and three copies. It costs 465 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::svd	1100	1600
# 288 copies, for about 36n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. On macOS, 88 copies, for Accelerate's HEEVD: the 8n³/3 real flops of its tridiagonal reduction that run as Hermitian matrix-vector products, at twice the complex matrix-vector rate, 5.9, the rest of its 36n³ at the rate for complex rank-32 updates, 81, and two copies. It costs 502 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::eigh	1100	580
# 800 copies, for about 100n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. It costs 2568 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. macOS runs this solver too, with only the vectors' last product on Accelerate, so the same expected cost applies there. It costs 2151 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::eig	4600	4800
# 2 copies, for three reads and one write per item.
Clip	4	4
# 2 copies, for three reads and one write per item.
Choose	4	4
[f32]
# 5.5 copies, for 22 vector ops: clamp, reduction by ln 2, a degree-9 polynomial, scaling by 2^n.
Exp	11	11
# 7 copies, for 27 vector ops: exp's steps with a longer polynomial near 0.
Expm1	14	14
# 5.25 copies, for 21 vector ops: a test for each block of 16 items that every item is positive, normal and finite, then the split into mantissa and exponent, one division, a series in s² and the combine. A block of 16 items that holds a zero, a negative, a subnormal, an infinity or NaN takes the full form with its special values, which costs about 1.7 times as much on macOS.
Ln	11	11
# 8.75 copies, for 35 vector ops: ln's steps plus the correction for 1 + x, with the block test on 1 + x and on whether x is 0. A block of 16 items that holds a zero, a negative, a subnormal, an infinity or NaN takes the full form with its special values, which costs about 1.5 times as much on macOS.
Log1p	18	18
# 5.25 copies, for 21 vector ops: ln's steps with a scaled combine.
Log2	11	11
# 5.25 copies, for 21 vector ops: ln's steps with a scaled combine.
Log10	11	11
# 5 copies, for 21 vector ops: reduction by π/2, a polynomial, the quadrant.
Sin	10	10
# 5.5 copies, for 22 vector ops: sin's steps with a shifted quadrant.
Cos	11	11
# 6.5 copies, for 26 vector ops: reduction, a polynomial, a division.
Tan	13	13
# 6 copies, for 24 vector ops: a square root past 1/2, a polynomial, selects.
Asin	12	12
# 6.5 copies, for 26 vector ops: asin's steps and a reflection.
Acos	13	13
# 5.5 copies, for 22 vector ops: a reduction by division, a polynomial, selects.
Atan	11	11
# 8 copies, for 32 vector ops: expm1, a division, selects.
Sinh	16	16
# 6.5 copies, for 26 vector ops: exp and its reciprocal.
Cosh	13	13
# 8 copies, for 32 vector ops: expm1 and a division.
Tanh	16	16
# 9 copies, for 37 vector ops: ln, a square root, selects.
Asinh	18	18
# 9 copies, for 37 vector ops: ln and a square root.
Acosh	18	18
# 8.5 copies, for 34 vector ops: log1p of a quotient.
Atanh	17	17
# 7 copies, for 29 vector ops: split, a polynomial, two Newton steps with divisions.
Cbrt	14	14
# 30 copies, for about 60 ops computed in f64 at half the lanes: ln and exp, special cases.
Pow	60	60
# 60 copies, for Pow's 60 ops in scalar f64, pair by pair, at one f32 copy each.
Pow.one	120	120
# 4 copies, for 16 vector ops: scaling, a square root, a division; two reads and a write take 1.5.
Hypot	8	8
# 30 copies, for Pow's steps in f64 with a reciprocal power.
Root	60	60
# 60 copies, for Root in scalar f64, pair by pair.
Root.one	120	120
# 1.5 copies, for two reads and one write per item.
Maximum	3	3
# 0.5 copies, for one read per item.
reduce::sum	1	1
# 0.5 copies, for one read per item.
reduce::max	1	1
# 1 copies, for one read and one write per item; the scan runs in vector steps. It costs 2.81 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied.
reduce::cumsum	2	6.3
# 1 copies, for one read and one write per item; the scan runs in vector steps.
reduce::cummax	2	2
# 3.75 copies, for the negate (1), a read and write in place (1), 7 FMAs (1.75).
polynomial::evaluate	5.5	5.5
# 75 copies, for 150 ops in f64 at half the lanes: a plain Lanczos sum, ln, exp, sinpi.
Gamma	150	150
# 50 copies, for 100 ops in f64 at half the lanes.
Lgamma	100	100
# 25 copies, for 100 vector ops: the piecewise rational.
Erf	50	50
# 25 copies, for 100 vector ops: the same pieces. It costs 50.3 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied.
Erfc	50	110
# 17.5 copies, for 70 vector ops: the same.
Erfinv	35	35
# 18 copies, for 72 vector ops: the same.
Erfcinv	36	36
# 420 copies, for 420 scalar f64 ops: incomplete_gamma's narrow route, a plain prefactor and about 25 steps, at one f32 copy each.
Gammainc	840	840
# 420 copies, for Gammainc's narrow route.
Gammaincc	840	840
# 1700 copies, for about four evaluations of Gammainc's narrow route, 1,700 scalar f64 ops. It costs about 3531.6 copies on macOS and 4780 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
Gammaincinv	7400	11000
# 850 copies, for 850 scalar f64 ops for a narrow route like incomplete_gamma: a plain prefactor (400) and about 30 steps. It costs about 2898.6 copies on macOS and 3708 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
Betainc	6000	8300
# 3400 copies, for about four evaluations of Betainc's narrow route. It costs about 8512 copies on macOS and 11278 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
Betaincinv	18000	26000
# 10 copies, for 78 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: exp of the real part and sin and cos of the imaginary part. The count leaves out `split`'s passes over the parts and the results. It costs about 20 copies on macOS. CI measured about 21 copies on 22 October, before `exp_parts` stopped calling `quarter` for every item. CI's earlier runs showed about 9 copies only because each divided by a copy read from memory. After that change CI measured 18.3, about twice its expected cost, where a budget of twice it would fail by chance, so both budgets stay held.
complex Exp	47	52
# 12.5 copies, for 100 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot, ln with care near |z| = 1, atan2. It costs about 30.5 copies on macOS and 27.1 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Ln	59	62
# 4.5 copies, for 36 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot, a square root, a division, selects. It costs 9.91 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS it costs about 8.2 copies. Its slice form calls the scalar `sqrt` for each item, which also scales each item against underflow. On 23 October 2026, running it through `split!` and `sqrt_parts`, as `Sqrt1mx2` does, cost 65% more at f32 and 10% more at f64.
complex Sqrt	9	23
# 16 copies, for 126 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: sin, cos, sinh and cosh.
complex Sin	32	32
# 17.5 copies, for 140 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: sin, cos, sinh, cosh and a division.
complex Tan	35	35
# 22.5 copies, for 180 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex square root of 1 - z², a complex ln, products. It costs 38.6 copies on CI on 22 October 2026, about twice that, where a budget of twice it would fail by chance, so its Linux budget is unchanged until the cost is studied.
complex Asin	45	120
# 16 copies, for 130 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex ln of a quotient. CI measured 26.2 on 22 October 2026, so its Linux budget follows the expected cost.
complex Atanh	32	32
# 104 copies, for f64's 420 ops computed in f64, which cost twice as many f32 copies. It costs 263 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied.
complex Lgamma	210	640
# 125 copies, for f64's 500 ops computed in f64, which cost twice as many f32 copies. It costs twice the f64 case's cost: about 254 copies on macOS, against f64's 132, and 353 on CI on 22 October 2026. Its macOS budget is twice the f64 case's held budget until that cost is studied, and its Linux budget is unchanged.
complex Gamma	560	810
# 2 copies, for 16 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: hypot; reading two floats and writing one take 0.75.
complex Abs	4	4
# 11.5 copies, for 92 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: two complex square roots, each a hypot pass and then one pass that writes both parts, then a product and a rebalance. It costs about 28.0 copies on macOS since `sqrt_parts` became one pass on 23 October 2026 (29.4 before), and 33.2 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Sqrt1mx2	59	92
# 23 copies, for 184 f64 ops per complex item, at a quarter copy per op and two floats per complex copy: a complex ln, a complex product, a complex exp. It costs about 52.3 copies on macOS and 51.5 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
complex Pow	110	130
# 64 copies, for 256 FMAs per result item, a quarter copy each, on rustymath's own kernels. On macOS, 4.4 copies, for the same 512 flops at Accelerate's rate for a 1024×1024 product.
linalg::PlusTimes	8.8	130
# 128 copies, for 256 steps of a max and an add per result item, a quarter copy per op.
linalg::MaxPlus	260	260
# 128 copies, for 256 steps of a min and an add per result item, a quarter copy per op.
linalg::MinPlus	260	260
# 128 copies, for 256 steps of a comparison and an add per result item, a quarter copy per op.
linalg::PlusEqual	260	260
# 35 copies of 64-bit items: these values fit f32 products exactly, whose 256 multiply-adds per result item take 64 f32 copies, 32 of 64-bit items, at a quarter copy each on rustymath's own kernels, with passes that find the operands' largest magnitudes, 1, convert both to f32, 1.5, and convert the result back, 0.75. On macOS, 5.6 copies, with Accelerate's f32 product at its rate for a 1024×1024 product, 2.4, and the same passes.
linalg::PlusTimes at i64	12	70
# 128 copies, for 256 steps of an integer comparison and an add per result item.
linalg::PlusEqual at i64	260	260
# 80 copies, for a radix sort of each 256-item row's keys alone, which costs about what an unstable comparison sort of them does: about 8 levels per item at about 10 copies a level of half-width items, as the f64 sorts measure them. A sorting network on explicit vectors would cost about 10 to 15 by instruction counts, unmeasured, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 83 copies on macOS, down from about 96 when the sort carried each float beside its key.
search::view_sort_along	160	160
# 52 copies, for a radix sort of each 32,768-item lane's keys alone: 4 byte passes, each scattering the keys to 256 places at about 13 copies, as measured on this hardware. A sorting network would gain here only as the base case of a long sort, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 52 copies on macOS, down from about 72 when the sort carried each float beside its key.
search::view_sort_along long lanes	110	110
# 30 copies, for a quickselect of each row's keys: about 3 comparisons per item at about 10 copies each, as the sorts measure comparisons of half-width items, plus a pass that computes the keys and one that writes the floats back. A vectorized kernel that partitions would cost less, as "Left for later" in basedpl's `meta/next-phases.md` records. It costs about 25 copies on macOS, down from about 33 when each comparison computed two keys. CI measured 22 on 22 October 2026, so its Linux budget follows the same expected cost.
search::view_partition_along	60	60
# 30 copies, for selecting the two middle keys of each row, which costs about what one partition does. It costs about 27 copies on macOS, down from about 66 when each comparison computed two keys. CI measured 23.6 on 22 October 2026, so its Linux budget follows the same expected cost.
search::view_quantiles_along	60	60
# 1.5 copies, for two reads per item, for the mean and the squares, and two ops.
stats::variance	3	3
# 1.5 copies, for reading the data and the weights once, with a multiply-add per item. It costs about 7.4 copies on macOS, because each chunk gathers the data and the weights into buffers, and a second pass gathers the weights again for their total. Two other methods measured slower on 21 October 2026: folding pairs of products and weights in one walk cost 10.6, because a buffer of pairs folds more slowly than the walk it saves, and reading each 64-item row in place cost 11.7, because each in-place read works out its row's offset with divisions and each row's fold pays its own setup. Reading the runs in place without copying them only ties with the gather at 64 items. A fold that sums each run straight into its output's accumulator, with no product buffer, would reach the expected cost, as step 4 in basedpl's `meta/next-phases.md` records. Both budgets stay held until then.
stats::average	150	650
# 22 copies, for 2n³/3 flops per n² items, as FMAs, plus the solve, at a quarter copy per FMA on rustymath's own kernels. It costs 67.6 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 11 copies: the copy into column order and the row swaps, 2.5, the products' 155 flops an item at Accelerate's rate for rank-32 updates, 5, and the 16-column leaves' 16 flops an item at the matrix-vector rate, 3.3. It costs 31.2 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::Lu::solve	73	140
# 64 copies, for 2n³ flops per n² items, at a quarter copy per FMA on rustymath's own kernels. It costs 149 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 22 copies: the LU as `linalg::Lu::solve` gives it, 11, then the two triangular solves from the permuted identity, which skip no zeros, 512 flops an item at Accelerate's rate for 128×128 products, 11, and writing the inverse, 1.
linalg::Lu::inverse	44	420
# 11 copies, for n³/3 flops per n² items, at a quarter copy per FMA on rustymath's own kernels. It costs 37 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 4.8 copies: the copy in and the copy closed up, 2, and its n³/3 flops at Accelerate's rate for rank-32 updates, 2.8. It costs 11.6 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::cholesky	35	81
# 85 copies, for 8n³/3 flops per n² items, 4n³/3 to factor and 4n³/3 to form Q, at a quarter copy per FMA on rustymath's own kernels. It costs 234 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 24 copies: the working copy and the writes of Q and R, 2, and those flops at Accelerate's rate for rank-32 updates, 22. It costs 52.2 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::qr	160	660
# 384 copies, for about 12n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 1142 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 161 copies, for Accelerate's GESDD: half the 8n³/3 flops of its bidiagonal reduction, which run as matrix-vector products, at the matrix-vector rate, 70, the rest of its 12n³ flops at the rate for rank-32 updates, 88, and three copies in and out. It costs 633 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::svd	1500	2800
# 288 copies, for about 9n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 799 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 88 copies, for Accelerate's SYEVD: half the 4n³/3 flops of its tridiagonal reduction, which run as symmetric matrix-vector products that use each item they read twice, at twice the matrix-vector rate, 17, the rest of its 9n³ flops at the rate for rank-32 updates, 69, and two copies. It costs 435 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eigh	940	1500
# 800 copies, for about 25n³ flops per n² items, with the vectors, at a quarter copy per FMA on rustymath's own kernels. It costs 3067 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 238 copies, for Accelerate's GEEV: the 2n³/3 flops of its Hessenberg reduction that run as matrix-vector products, at the matrix-vector rate, 35, the rest of its 25n³ flops at the rate for rank-32 updates, 201, and two copies. It costs 2316 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eig	5100	5600
# 320 copies, for about 10n³ flops per n² items, at a quarter copy per FMA on rustymath's own kernels. It costs 1673 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 113 copies, for GEEV without vectors: the same matrix-vector part, 35, the rest of its 10n³ flops at the rate for rank-32 updates, 77, and one copy. It costs 1356 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
linalg::eigenvalues	3000	3400
# 5 copies, for 2mn² flops on 4096×16 (32 per item) and reading the matrix, at a quarter copy per FMA on rustymath's own kernels. On CI's x86 runner it cost 52.8 copies on 22 October 2026, through CholeskyQR2, which then took this size on rustymath's own kernels. Earlier runs put Householder there about 1.35 times faster, and `tall_for_qr` now gives this size to Householder wherever Accelerate doesn't run. Householder's reflections are matrix-vector passes, far below the FMA rate this analysis assumes: on the Mac's own kernels, f64 costs about 32 copies. Through Householder, CI measured 40.8 later that day. Its Linux budget is unchanged until Householder's expected cost is worked out. On macOS, 17 copies, through CholeskyQR2: its two Gram matrices, 32 flops an item each, at Accelerate's rate for a 4096×16 matrix's transpose times the matrix, 7.4 each, the solve with R, 16 flops an item at about 15 flops in a copy's time, which Accelerate measured for a 4096×16 matrix times a 16×16 one, half its rank-k rate, 1.1, a copy of the matrix, 1, and the reduction of the right side, 0.5.
linalg::lstsq	34	100
# 21 copies, for 8n³/3 real flops per n² complex items, two floats per complex copy, at a quarter copy per FMA on rustymath's own kernels. It costs 75.3 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 10 copies: the copy into column order and the row swaps, 1.9, the products' 277 real flops an item at Accelerate's rate for complex rank-32 updates, 4.6, and the leaves' 64 at the complex matrix-vector rate, 3.6. It costs 29.2 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::Lu::solve	81	150
# 85 copies, for 32n³/3 real flops per n² complex items, half to factor and half to form Q, at a quarter copy per FMA on rustymath's own kernels. It costs 399 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 25 copies: the working copy and the writes, 2, and those flops at Accelerate's rate for complex rank-32 updates, 23. It costs 98.6 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::qr	240	720
# 384 copies, for about 48n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. It costs 1209 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 132 copies, for Accelerate's GESDD: the 16n³/3 real flops of its bidiagonal reduction that run as matrix-vector products, at the complex matrix-vector rate, 38, the rest of its 48n³ at the rate for complex rank-32 updates, 91, and three copies. It costs 768 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::svd	1600	2400
# 288 copies, for about 36n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. It costs 707 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. On macOS, 83 copies, for Accelerate's HEEVD: the 8n³/3 real flops of its tridiagonal reduction that run as Hermitian matrix-vector products, at twice the complex matrix-vector rate, 9.5, the rest of its 36n³ at the rate for complex rank-32 updates, 71, and two copies. It costs 622 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::eigh	1400	1200
# 800 copies, for about 100n³ real flops per n² complex items, at a quarter copy per FMA on rustymath's own kernels. It costs 2558 copies on CI on 22 October 2026, more than twice that, so its Linux budget is unchanged until the cost is studied. macOS runs this solver too, with only the vectors' last product on Accelerate, so the same expected cost applies there. It costs 2445 copies on macOS on 23 October 2026, more than twice that, so its macOS budget is unchanged until the cost is studied.
complex linalg::eig	5000	5300
# 1 copies, for reading two items and writing one per lane of 2. It costs about 2.4 copies on macOS and 3.54 on CI on 22 October 2026, more than twice that, so both budgets are unchanged until the cost is studied.
Array::differences short lanes	5.2	5.2
# 1 copies, for one read and one write per item.
Array::differences	2	2
# 0.5 copies, for one write per output item; each input is read once for 64 outputs. It costs about 1.1 copies on macOS, more than twice that, so its macOS budget is unchanged until the cost is studied. CI measured 0.8 on 22 October 2026, so its Linux budget follows the expected cost.
Array::broadcasted	2.2	1
# 2 copies, for three reads and one write per item.
Clip	4	4
# 2 copies, for three reads and one write per item.
Choose	4	4
[i64]
# 0.75 copies, for reading 4 bytes and writing 8 per item, against a copy that moves 16.
Buffer::cast i32	1.5	1.5
