Skip to content
Numerical Method , home
Menu

Writing2026

Precision Is a Resource: How Much Arithmetic Does a Covariance Matrix Deserve?

The thesis of this article fits in two sentences. When we solve linear systems with a sample covariance matrix, as we do whenever we build a minimum-variance portfolio, a risk model or a regression on correlated signals, the floating-point precision we need is set by how much data we have and by how we use the answer, not by the size or the conditioning of the problem. For a single estimate the data are forgiving. For a portfolio re-estimated and traded every day they are not.

Both halves are measured below, on synthetic markets. For minimum-variance weights estimated once from TT observations, the ratio of rounding error to estimation error behaves like C uTC\,u\sqrt{T}, where uu is the unit roundoff. In a Gaussian five-factor model with n/T≤0.2n/T \le 0.2, the median of CC lies between 2.0 and 3.2 across two portfolio sizes, five sample lengths and three floating-point formats, and the textbook condition number largely drops out of the ratio. When the same weights are re-estimated daily on a rolling window, consecutive estimates share almost all their data, so their statistical errors are nearly identical, while their rounding errors are not. The rounding noise then appears as spurious turnover, and its share of true turnover grows like u Tu\,T, not uTu\sqrt{T}. In the same synthetic market binary16 adds about half again to daily turnover at four years of history; binary32 adds about one part in ten thousand.

The practical consequence is simple. Binary32 is ample for covariance linear algebra in every configuration measured here. Binary64 carries more than 30 bits, nine or more decimal orders of magnitude, beyond what either criterion can use for daily data. The 16-bit formats are adequate only for estimates used once. There are, however, good reasons to keep binary64 that this accuracy argument does not touch, and they are listed near the end.

Why ask now?

Why should anyone revisit a question that seemed settled in 1985? The IEEE 754 standard made binary64 the unremarkable default of scientific computing, and for good reason: it was cheap insurance. Very few people working in quantitative finance chose double precision; it was simply what double meant.

What has changed is that the formats are no longer interchangeable. The 2008 revision of IEEE 754 added a 16-bit binary format, the bfloat16 format has spread with machine-learning accelerators, and halving the bits halves the storage and memory traffic of a matrix. Whether that buys speed depends on the hardware and the library, and it is not automatic. On the machine used for this article, an Apple M4 Pro running numpy 2.0.2 with Apple’s Accelerate library, binary32 matrix multiplication was 1.8 to 4.0 times faster than binary64 for nn from 100 to 4,000, LU solves ran at the same speed (0.92 to 1.00 times), and Cholesky factorization in binary32 was slower than in binary64 (0.64 to 0.93 times). This article therefore makes only the accuracy argument. How many bits does the answer deserve? Whether a given machine delivers those bits faster is a separate question, answered by a benchmark on that machine.

Numerical analysts have also given us better tools to answer the accuracy question. Classical rounding error bounds grow like nunu and are, as Wilkinson already observed, wildly pessimistic. Higham and Mary (2019) proved that, under a model in which rounding errors are independent with zero mean, the constant can be replaced by one growing like n u\sqrt{n}\,u, with high probability. Connolly, Higham and Mary (2021) showed that stochastic rounding satisfies a weaker form of that model without further assumptions. Carson and Higham (2018) showed how to factorize a matrix in low precision and still obtain a working-precision answer by refining in higher precision.

What is missing is an answer to the user’s question: how much precision does my problem deserve? The numerical analyst answers in terms of κ(A)\kappa(A). For estimated matrices this is, for the most part, the wrong question.

Two errors, one answer

Let Σ\Sigma be the true covariance matrix of nn asset returns and Σ^\hat\Sigma the sample covariance from TT observations. The minimum-variance weights are

w(Σ)=Σ−111⊤Σ−11.w(\Sigma) = \frac{\Sigma^{-1}\mathbf 1}{\mathbf 1^{\top}\Sigma^{-1}\mathbf 1}.

What we would like is w(Σ)w(\Sigma). What we can estimate is w(Σ^)w(\hat\Sigma). What we actually compute, in a floating-point format with unit roundoff uu, is a third vector w^\hat w. There are therefore two errors, and they have different origins:

∥w(Σ^)−w(Σ)∥∥w(Σ)∥⏟statistical errorand∥w^−w(Σ^)∥∥w(Σ^)∥⏟numerical error.\underbrace{\frac{\lVert w(\hat\Sigma) - w(\Sigma)\rVert}{\lVert w(\Sigma)\rVert}}_{\text{statistical error}} \qquad\text{and}\qquad \underbrace{\frac{\lVert \hat w - w(\hat\Sigma)\rVert}{\lVert w(\hat\Sigma)\rVert}}_{\text{numerical error}} .

The first is the price of finite data and has nothing to do with computers. The second is the price of finite arithmetic and has nothing to do with data. For an estimate that is used once, the sensible requirement for the second is that it be small compared with the first. Driving the numerical error down to 10−1310^{-13} when the statistical error is 10−110^{-1} buys nothing: no decision changes, no risk number changes. We return later to the cases where this criterion is the wrong one.

Why the condition number (largely) cancels

Both errors are perturbations of the same matrix, and to first order they reach the weights through the same linear map.

Proposition 1 (shared first-order operator). Let AA be symmetric positive definite, x=A−11x = A^{-1}\mathbf 1 and w=x/(1⊤x)w = x/(\mathbf 1^{\top}x). For a symmetric perturbation EE with ∥A−1E∥<1\lVert A^{-1}E\rVert < 1,

w(A+E)−w(A)=LA(E)+O(∥E∥2),LA(E)=−11⊤x (I−w1⊤)A−1E x.w(A+E) - w(A) = \mathcal L_A(E) + O(\lVert E\rVert^2), \qquad \mathcal L_A(E) = -\frac{1}{\mathbf 1^{\top}x}\,\bigl(I - w\mathbf 1^{\top}\bigr)A^{-1}E\,x .

Proof. From (A+E)−1=A−1−A−1EA−1+O(∥E∥2)(A+E)^{-1} = A^{-1} - A^{-1}EA^{-1} + O(\lVert E\rVert^2) we get δx=−A−1Ex+O(∥E∥2)\delta x = -A^{-1}Ex + O(\lVert E\rVert^2). Differentiating w=x/(1⊤x)w = x/(\mathbf 1^{\top}x) gives δw=(δx−w 1⊤δx)/(1⊤x)\delta w = (\delta x - w\,\mathbf 1^{\top}\delta x)/(\mathbf 1^{\top}x), and substituting proves the claim. □\square

Apply this with A=Σ^A = \hat\Sigma. The statistical error corresponds to Estat=Σ−Σ^E_{\text{stat}} = \Sigma - \hat\Sigma, since the truth is a perturbation of the estimate. A backward stable solver produces the exact solution of a nearby problem (Σ^+Enum)x^=1(\hat\Sigma + E_{\text{num}})\hat x = \mathbf 1, so the numerical error corresponds to EnumE_{\text{num}}, the backward error. The ratio we care about is therefore, to first order,

numerical errorstatistical error≈∥LΣ^(Enum)∥∥LΣ^(Estat)∥.\frac{\text{numerical error}}{\text{statistical error}} \approx \frac{\lVert\mathcal L_{\hat\Sigma}(E_{\text{num}})\rVert}{\lVert\mathcal L_{\hat\Sigma}(E_{\text{stat}})\rVert}.

The operator LΣ^\mathcal L_{\hat\Sigma} contains Σ^−1\hat\Sigma^{-1}, which is where the condition number lives. A textbook bound applies ∥Σ^−1∥\lVert\hat\Sigma^{-1}\rVert to the numerator and declares the numerical error to be of order κu\kappa u. But the statistical error passes through the same operator. If the two perturbations were equally “generic” with respect to LΣ^\mathcal L_{\hat\Sigma}, the amplification would cancel exactly and the ratio would depend only on the sizes of the perturbations.

They are not equally generic, and this can be measured. Write the first-order error Σ^−1Ex\hat\Sigma^{-1}Ex in the eigenbasis (λi,vi)(\lambda_i, v_i) of Σ^\hat\Sigma; its components are vi⊤Ex/λiv_i^{\top}Ex/\lambda_i. Two quantities summarize where a perturbation lands: the share of the squared error that comes from the bottom tenth of the eigenvalues, and the amplification ∥Σ^−1Ex∥/(∥Ex∥/λmin⁡)\lVert\hat\Sigma^{-1}Ex\rVert / (\lVert Ex\rVert/\lambda_{\min}), which equals one in the worst case. The table compares the sampling error, the rounding error of a binary16 Cholesky factorization (L^L^⊤−Σ^\hat L\hat L^{\top} - \hat\Sigma) and a random symmetric Gaussian matrix, for n=100n = 100 and 50 samples per row (median, with interquartile range for the last column).

n/Tn/T bottom-decile share: sampling rounding random amplification ratio, rounding / sampling
0.05 0.45 0.43 0.48 2.18 (1.68–2.84)
0.2 0.68 0.51 0.49 1.69 (1.24–1.98)
0.5 0.91 0.73 0.73 1.07 (0.89–1.31)
0.8 1.00 0.94 0.93 0.54 (0.41–0.75)

Empirical observation (synthetic Gaussian factor model). Rounding errors behave like a random perturbation: their bottom-decile share matches the random matrix at every n/Tn/T. Sampling errors do not. As n/Tn/T grows they concentrate in the directions of the smallest eigenvalues, which are exactly the eigenvalues that the Marchenko–Pastur law (Marchenko and Pastur, 1967) pushes towards zero. The cancellation is therefore partial: for n/T≤0.2n/T \le 0.2 rounding errors are amplified up to about twice as much as sampling errors, relative to their size, and that factor is absorbed into the constant CC below. As n/Tn/T approaches one the balance reverses and the residual amplification is no longer constant. This is where the regularity reported next breaks down.

The experiment

The test is deliberately plain. We take a five-factor model with a dominant market factor, n∈{50,200}n \in \{50, 200\} assets and daily scaling. We draw Gaussian returns of length TT from 100 to 16,000, form the sample covariance, compute w(Σ)w(\Sigma) and w(Σ^)w(\hat\Sigma) in binary64, then compute w^\hat w by Cholesky factorization and two triangular solves in emulated bfloat16 (u=2−8u = 2^{-8}), binary16 (u=2−11u = 2^{-11}) and binary32 (u=2−24u = 2^{-24}). Every arithmetic result is rounded to the target significand; the exponent range is not emulated here (that is done later). Each row uses 50 independent samples. The code has no dependencies beyond numpy and is published with this article.

Line chart with interquartile bands. For n equal to 200 assets and T from 1,000 to 16,000, the statistical error falls from about 0.42 to 0.09. The numerical errors are nearly flat in T: 0.12 to 0.16 for bfloat16, 0.015 to 0.020 for binary16 and about 2 times 10 to the minus 6 for binary32. Fig. 1 — Statistical error falls like T−1/2T^{-1/2}; numerical error does not depend on TT. Lines are medians and bands interquartile ranges over 50 samples. Where the gold line crosses a black line, that precision stops being adequate for a single estimate.

The table divides the error ratio by uTu\sqrt{T}. If the scaling holds, the normalized ratio CC should be roughly constant. Entries are medians over 50 samples, with the interquartile range for binary16.

nn TT n/Tn/T κ(Σ^)\kappa(\hat\Sigma) statistical error CC, bf16 CC, binary16 (IQR) CC, binary32
50 1,000 0.05 1.9×1021.9\times10^{2} 0.204 2.42 2.22 (1.92–2.84) 2.08
50 4,000 0.013 1.8×1021.8\times10^{2} 0.098 2.15 2.24 (1.76–2.50) 2.22
50 16,000 0.003 1.8×1021.8\times10^{2} 0.049 2.03 2.09 (1.74–2.54) 1.98
50 250 0.2 2.9×1022.9\times10^{2} 0.449 2.40 2.43 (2.10–2.83) 2.33
200 1,000 0.2 1.2×1031.2\times10^{3} 0.421 3.16 2.92 (2.63–3.30) 2.92
200 4,000 0.05 8.0×1028.0\times10^{2} 0.192 2.63 2.64 (2.43–2.85) 2.60
200 16,000 0.013 7.4×1027.4\times10^{2} 0.094 2.48 2.52 (2.30–2.88) 2.54
50 100 0.5 7.8×1027.8\times10^{2} 0.935 3.52 3.28 (2.84–4.42) 3.55
200 400 0.5 3.2×1033.2\times10^{3} 0.851 5.23 4.36 (3.86–5.02) 4.41
200 250 0.8 2.0×1042.0\times10^{4} 1.699 breakdown 10.76 (9.38–13.33) 10.31

For n/T≤0.2n/T \le 0.2, across a factor of four in nn, a factor of sixteen in TT, a factor of seven in κ\kappa and five orders of magnitude in uu, the median of CC stays between 1.98 and 3.16. Two further regularities appear in the same rows: the statistical error lies between 0.84 and 0.93 times n/(T−n)\sqrt{n/(T-n)} in every configuration, and the numerical error lies between 1.8 and 2.9 times n u\sqrt{n}\,u. The n\sqrt n cancels, and what remains is uTu\sqrt T.

Should the scaling be uTu\sqrt{T} or uT−nu\sqrt{T-n}, which the statistical error suggests? Over the 21 format-configuration pairs with n/T≤0.2n/T \le 0.2, the coefficient of variation of CC is 0.13 with uTu\sqrt T and 0.16 with uT−nu\sqrt{T-n}; including n/T=0.5n/T = 0.5 it is 0.29 against 0.45. The simpler form fits better, and we keep it.

At n/T=0.5n/T = 0.5 the constant has risen to between 3.3 and 5.2, and at n/T=0.8n/T = 0.8 it is about 10, with bfloat16 Cholesky breaking down in all 50 samples. This is the regime of the alignment table, in which the weights are in any case dominated by estimation error: the statistical error is 0.85 to 1.7.

Conjecture 1 (precision–sample law). For minimum-variance weights computed by a backward stable Cholesky solve from a sample covariance of TT observations of nn assets, with n/Tn/T bounded away from one, the ratio of numerical to statistical error satisfies

∥w^−w(Σ^)∥∥w(Σ^)−w(Σ)∥≍uT,\frac{\lVert\hat w - w(\hat\Sigma)\rVert}{\lVert w(\hat\Sigma) - w(\Sigma)\rVert} \asymp u\sqrt{T},

with a constant that depends on the factor structure and on n/Tn/T but not on κ(Σ^)\kappa(\hat\Sigma). The evidence is the synthetic experiment above; it supports constants of 2 to 3.2 for n/T≤0.2n/T \le 0.2 and shows the constant growing beyond that.

What would a proof need? It would need a probabilistic forward error analysis for the statistic ww, in the direction that LΣ^\mathcal L_{\hat\Sigma} weights, together with a description of how sampling errors are distributed over the eigenvectors of Σ^\hat\Sigma. The second is random matrix theory; the alignment table shows why it cannot be skipped. The first is, as far as I know, open.

Heavier tails, regime changes and shrinkage

Does the constant survive less convenient data and a better estimator? We reran the configuration n=100n = 100, T∈{1000,4000}T \in \{1000, 4000\} with three return distributions (Gaussian; multivariate Student-t with 4 degrees of freedom, scaled to the same covariance; and a two-state regime-switching volatility model with volatility multipliers 0.7 and 1.8 and daily persistence 0.98, scaled so that the unconditional covariance is unchanged) and two estimators (the sample covariance and the Ledoit–Wolf shrinkage estimator towards a scaled identity). Entries are medians over 50 samples with the interquartile range of CC for binary16; δ\delta is the Ledoit–Wolf shrinkage intensity.

estimator returns TT statistical error κ\kappa CC, binary16 (IQR) δ\delta
sample Gaussian 1,000 0.286 447 2.56 (2.23–2.85) —
sample Gaussian 4,000 0.133 374 2.45 (2.26–2.91) —
sample Student-t, 4 dof 1,000 0.391 566 2.13 (1.93–2.46) —
sample Student-t, 4 dof 4,000 0.224 415 1.56 (1.34–1.85) —
sample regime switching 1,000 0.363 506 2.19 (1.81–2.49) —
sample regime switching 4,000 0.168 383 1.88 (1.68–2.24) —
Ledoit–Wolf Gaussian 1,000 0.271 378 2.38 (2.00–2.77) 0.010
Ledoit–Wolf Gaussian 4,000 0.131 360 2.41 (2.13–2.71) 0.002
Ledoit–Wolf Student-t, 4 dof 1,000 0.344 298 1.77 (1.51–2.02) 0.032
Ledoit–Wolf Student-t, 4 dof 4,000 0.216 338 1.41 (1.21–1.68) 0.010
Ledoit–Wolf regime switching 1,000 0.326 377 2.03 (1.80–2.35) 0.015
Ledoit–Wolf regime switching 4,000 0.163 359 2.02 (1.79–2.28) 0.004

Empirical observation (synthetic). Heavy tails and regime switching raise the statistical error, by up to 68% here, while leaving the numerical error essentially unchanged, so they lower CC (to between 1.4 and 2.2). That strengthens the conclusion rather than weakening it. Shrinkage answers the question the first version of this article left open, for these configurations: the Ledoit–Wolf intensity is small at n/T≤0.1n/T \le 0.1 (between 0.002 and 0.032), it lowers the condition number by between 4% and 47%, and it moves CC by at most about 17% in either direction. Heavier shrinkage, which is what large n/Tn/T calls for, was not tested.

A budget in bits for a single estimate

If the scaling holds, choosing a precision for an estimate that will be used once becomes arithmetic. Suppose we want the numerical error to be at most a fraction ρ\rho of the statistical error. With u=2−tu = 2^{-t} for a tt-bit significand and C=3.2C = 3.2, the upper end of the range measured for n/T≤0.2n/T \le 0.2, we need

t  ≥  log⁡2 ⁣CTρ.t \;\ge\; \log_2\!\frac{C\sqrt T}{\rho}.
history (daily) TT bits for ρ=10%\rho = 10\% bits for ρ=1%\rho = 1\%
1 year 250 9.0 12.3
4 years 1,000 10.0 13.3
16 years 4,000 11.0 14.3
64 years 16,000 12.0 15.3

Binary16, with 11 bits, is adequate at the 10% level up to about sixteen years of daily data. Bfloat16, with 8 bits, is not adequate at the 10% level for any history in the table. Binary32, with 24 bits, stays within 1% of the statistical error up to TT of about 2.7×1092.7\times10^9. The most demanding entry needs 15.3 bits, so binary64’s 53 bits are about 38 bits, roughly 11 decimal orders of magnitude, more than a single estimate can use, and 29 bits (about 8.7 decimal orders) more than binary32.

That is the forgiving half of the thesis. The next section is the other half.

The answer is used every day: rolling re-estimation and turnover

A risk model or a minimum-variance portfolio is rarely estimated once. It is re-estimated every day on a rolling window, and every change in the weights is a trade. Two estimates on consecutive days share T−1T-1 of their TT observations, so their statistical errors are almost the same and the true day-to-day change in w(Σ^t)w(\hat\Sigma_t) is small. Rounding errors have no such memory: the computation on day tt is a fresh computation, and its rounding errors are, for practical purposes, independent of those on day t−1t-1. A precision that is harmless for the level of the weights can therefore be harmful for their changes.

The experiment: n=50n = 50 assets with T=250T = 250 and T=1,000T = 1{,}000, and n=100n = 100 with T=1,000T = 1{,}000; weights recomputed every day for 250 days (100 days for n=100n = 100) in binary64, binary32, binary16 and bfloat16; 50 independent markets. We measure the one-way turnover 12∑i∣wt,i−wt−1,i∣\tfrac12\sum_i\lvert w_{t,i} - w_{t-1,i}\rvert averaged over days, the true turnover of the binary64 weights, and the numerical component, which is the turnover of the difference wtlow−wtbinary64w_t^{\text{low}} - w_t^{\text{binary64}}.

nn TT true turnover binary16: numerical / true (IQR) binary16: extra turnover bfloat16: numerical / true binary32: numerical / true
50 250 5.6% 0.32 (0.28–0.35) +6.8% 2.4 3.9×10−53.9\times10^{-5}
50 1,000 1.1% 1.00 (0.94–1.13) +48% 6.8 1.3×10−41.3\times10^{-4}
100 1,000 1.8% 1.15 (1.06–1.23) +60% 8.0 1.4×10−41.4\times10^{-4}

Log-log chart of the numerical share of daily turnover against the unit roundoff for three configurations. The share grows linearly with u, from about 10 to the minus 4 in binary32 through about 1 in binary16 to between 2 and 8 in bfloat16, and follows the reference line 2.6 times u times T. Fig. 2 — The numerical share of daily turnover is proportional to uu over five orders of magnitude, and larger for longer windows. Medians and interquartile ranges over 50 markets.

Empirical observation (synthetic). The numerical share of turnover is close to C′ u TC'\,u\,T with C′C' between 1.75 and 2.6 in all nine format-configuration pairs, from binary32 to bfloat16. Two facts explain the form of this law, heuristically. The numerical part of the daily change is the difference of two nearly independent rounding errors, so its size is about 2\sqrt2 times the numerical error of the level, which by the previous sections is of order n u\sqrt n\,u; in the data the ratio is 1.38 to 1.42 for binary32 and binary16 (1.19 to 1.36 for bfloat16, where the errors are no longer small). The true daily change is of order 1/T1/T, because the window moves by one observation in TT; between T=250T = 250 and T=1,000T = 1{,}000 it fell from 5.6% to 1.1%. The ratio of the two grows like u Tu\,T.

The extra turnover is smaller than the numerical share, because the two components are nearly orthogonal and add roughly in quadrature: a numerical share ss raises turnover by about 1+s2−1\sqrt{1+s^2} - 1, which predicts 4.9%, 41% and 52% for the three binary16 rows against the measured 6.8%, 48% and 60%. A 10% increase in turnover therefore corresponds to a numerical share of about 0.46.

The bit budget for a daily-rebalanced portfolio follows from C′uT≤ρC'uT \le \rho, with C′=2.6C' = 2.6:

t  ≥  log⁡2 ⁣C′Tρ.t \;\ge\; \log_2\!\frac{C' T}{\rho}.
history (daily) TT bits for numerical share ≤10%\le 10\% ≤1%\le 1\%
1 year 250 12.7 16.0
4 years 1,000 14.7 18.0
16 years 4,000 16.7 20.0
64 years 16,000 18.7 22.0

The turnover criterion is stricter than the single-estimate criterion by four to seven bits, and it rules out both 16-bit formats for daily rebalancing at every history length in the table. Binary32 satisfies it with room to spare: by the same formula its numerical share stays below 1% up to T≈6.5×104T \approx 6.5\times10^{4} and below 10% up to T≈6.5×105T \approx 6.5\times10^{5}. Against the most demanding entry, 22 bits, binary64 still carries 31 surplus bits, about nine decimal orders of magnitude.

Conditioning decides existence, not accuracy

Does the condition number then play no role? It plays one, but a different one. A low-precision Cholesky factorization can fail. When κu\kappa u is large, rounding can make a pivot non-positive and the factorization breaks down. A classical sufficient condition due to Demmel guarantees success when a modest multiple of n3/2κ2(H)un^{3/2}\kappa_2(H)u is below one, where HH is the matrix scaled to unit diagonal (Higham 2002, ch. 10). In our experiments bfloat16 broke down in all 50 samples with n=200n = 200, T=250T = 250, where κu≈77\kappa u \approx 77. Binary16 survived there with κu≈10\kappa u \approx 10, which shows how conservative the sufficient condition is.

So conditioning determines whether you can factorize at all in a given precision. Once the factorization exists, even a poor low-precision factor can be turned into an accurate solve. In classical iterative refinement we keep the low-precision factor L^\hat L, compute residuals r=b−Ax^r = b - A\hat x in binary64, solve L^L^⊤d=r\hat L\hat L^{\top}d = r with the cheap factor, and update x^←x^+d\hat x \leftarrow \hat x + d. Carson and Higham (2018) analyse this, and its three-precision generalizations, in detail. Informally, each step multiplies the error by a factor of order κuf\kappa u_f, where ufu_f is the factorization precision, until the error reaches the accuracy the residual precision allows.

Line chart of relative error against refinement step. Binary32 reaches about 10 to the minus 15 after two steps. Binary16 with kappa u of 0.23 and bfloat16 with kappa u of 1.9 converge linearly. Binary16 with kappa u of 3.9 converges more slowly, and binary16 with kappa u of 67 diverges. Fig. 3 — Refinement with a low-precision Cholesky factor and binary64 residuals (n=100n = 100, T=1000T = 1000). The contraction factor per step is about 0.050.05 to 0.130.13 times κu\kappa u.

Figure 3 shows the textbook picture with real numbers. A binary32 factor gives binary64 accuracy within two to four steps at every condition number we tried, up to κ=7×105\kappa = 7\times10^{5}. A binary16 factor with κu=0.23\kappa u = 0.23 contracts the error by a factor of about 0.020.02 per step. A bfloat16 factor with κu=1.9\kappa u = 1.9, which by the usual rule should not work at all, still contracts by about 0.250.25 per step. Binary16 with κu=3.9\kappa u = 3.9 contracts by about 0.20.2. At κu=67\kappa u = 67 the iteration diverges, as it must.

Refinement is also the remedy for the turnover problem, if a low-precision factorization is wanted for other reasons: a refined solve has the accuracy of the residual precision, and its day-to-day rounding noise is correspondingly small.

The exponent range: a format is more than its significand

All the experiments so far emulate only the significand. A real binary16 number also has a small exponent range: the largest finite value is 65,504, the smallest normal number is about 6.1×10−56.1\times10^{-5}, and below that numbers become subnormal and lose precision. Bfloat16 has the exponent range of binary32 and does not have this problem. We repeated the single-estimate experiment (n=50n = 50, T=1,000T = 1{,}000, 50 samples) with full emulation of subnormals, underflow and overflow, for two universes: one with typical daily variances (between 1.1×10−41.1\times10^{-4} and 2.4×10−32.4\times10^{-3} in this model) and a low-volatility universe with all volatilities divided by ten (variances between 1.1×10−61.1\times10^{-6} and 2.4×10−52.4\times10^{-5}). Entries are the number of failed samples (breakdown, overflow or non-finite weights) and the median numerical error of the rest.

universe scaling binary16, significand only binary16, full format bfloat16, full format
typical raw daily covariance 0 failed; 6.8×10−36.8\times10^{-3} 0 failed; 8.1×10−38.1\times10^{-3} 0 failed; 5.2×10−25.2\times10^{-2}
typical returns in basis points 0 failed; 6.6×10−36.6\times10^{-3} 50 failed 0 failed; 5.4×10−25.4\times10^{-2}
typical correlation matrix 0 failed; 6.5×10−36.5\times10^{-3} 0 failed; 6.6×10−36.6\times10^{-3} 0 failed; 5.0×10−25.0\times10^{-2}
low volatility raw daily covariance 0 failed; 7.1×10−37.1\times10^{-3} 50 failed 0 failed; 5.4×10−25.4\times10^{-2}
low volatility returns in basis points 0 failed; 6.5×10−36.5\times10^{-3} 0 failed; 6.5×10−36.5\times10^{-3} 0 failed; 5.3×10−25.3\times10^{-2}
low volatility correlation matrix 0 failed; 6.6×10−36.6\times10^{-3} 0 failed; 6.6×10−36.6\times10^{-3} 0 failed; 5.3×10−25.3\times10^{-2}

Empirical observation (synthetic). The failures are overflows, and they come from the solution, not the matrix. The minimum-variance system Σx=1\Sigma x = \mathbf 1 has a solution of size about 1/λ1/\lambda: in the typical universe its entries reach 1.3×1041.3\times10^{4}, which fits in binary16; in the low-volatility universe they reach 1.3×1061.3\times10^{6}, which does not. Rescaling returns to basis points multiplies the covariance by 10810^{8}, which repairs the low-volatility case and breaks the typical one, because covariances of up to 2.4×1052.4\times10^{5} no longer fit. Basis points move the problem rather than solve it. The robust remedy is to work with the correlation matrix: with DD the diagonal of Σ^\hat\Sigma, solve Cy=D−1/21C y = D^{-1/2}\mathbf 1 and set x=D−1/2yx = D^{-1/2}y, doing the O(n)O(n) scaling in higher precision. It never failed, and its error equals that of the significand-only emulation. When nothing overflows, subnormals cost little: the raw typical case lost about 20% of accuracy, from 6.8×10−36.8\times10^{-3} to 8.1×10−38.1\times10^{-3}.

A different regime: long sums

Not every computation in finance is a linear solve. Many are accumulations: a profit-and-loss series summed over years, a Monte Carlo estimator averaged over millions of paths, an exponentially weighted statistic updated tick by tick. Here the relevant count is the number of operations, not the sample size, and round-to-nearest has a failure mode that no amount of data fixes.

Accumulate NN positive increments of size about 10−310^{-3} in a format with an 11-bit significand. Once the running sum s^\hat s exceeds roughly x/ux/u, each new increment is smaller than half the spacing of the floating-point numbers near s^\hat s, and round-to-nearest returns s^\hat s unchanged. The sum stagnates: in our runs it stalls near 4 while the true sum climbs to 262, an error of 98.5% at N=218N = 2^{18} (Figure 4).

Stochastic rounding rounds yy up to the next representable number with probability equal to its fractional distance from the number below, so E[fl⁡(y)]=y\mathbb E[\operatorname{fl}(y)] = y. Connolly, Higham and Mary (2021) showed that this makes the rounding errors mean independent and that n u\sqrt n\,u backward error bounds then hold without further assumptions. For accumulations of positive terms the following bound is short to prove.

Theorem 2 (stochastic rounding does not drift). Let x1,…,xN≥0x_1, \dots, x_N \ge 0 be representable numbers with exact partial sums sks_k and total S=sNS = s_N. Let s^0=0\hat s_0 = 0 and s^k=fl⁡SR(s^k−1+xk)\hat s_k = \operatorname{fl}_{\mathrm{SR}}(\hat s_{k-1} + x_k) with a tt-bit significand, and put u=2−tu = 2^{-t}. Then E[s^N]=S\mathbb E[\hat s_N] = S and

E[(s^N−S)2]  ≤  u(S2+∑k=1Nxk2)+R,\mathbb E\bigl[(\hat s_N - S)^2\bigr] \;\le\; u\Bigl(S^2 + \sum_{k=1}^{N}x_k^2\Bigr) + R,

where the remainder RR comes only from the at most B=⌈log⁡2(S/xmin⁡)⌉+1B = \lceil\log_2(S/x_{\min})\rceil + 1 steps at which the sum enters a new binade, and satisfies R≤(1+o(1)) B u2S2R \le (1+o(1))\,B\,u^2S^2. In particular the relative root-mean-square error is at most u (1+o(1))\sqrt u\,(1 + o(1)), independently of NN.

Proof. Write yk=s^k−1+xky_k = \hat s_{k-1} + x_k and εk=s^k−yk\varepsilon_k = \hat s_k - y_k, so that s^N−S=∑kεk\hat s_N - S = \sum_k \varepsilon_k. Let Fk\mathcal F_{k} be the history up to step kk. Stochastic rounding gives E[εk∣Fk−1]=0\mathbb E[\varepsilon_k \mid \mathcal F_{k-1}] = 0, so the errors form a martingale difference sequence. Hence E[s^N]=S\mathbb E[\hat s_N] = S, and since cross terms vanish, E[(s^N−S)2]=∑kE[Var⁡(εk∣Fk−1)]\mathbb E[(\hat s_N - S)^2] = \sum_k \mathbb E[\operatorname{Var}(\varepsilon_k \mid \mathcal F_{k-1})].

Let Δk\Delta_k be the spacing of tt-bit numbers at yky_k, so that Δk≤2u yk\Delta_k \le 2u\,y_k, and let dkd_k be the distance from yky_k down to the nearest representable number. Rounding up has probability dk/Δkd_k/\Delta_k, so Var⁡(εk∣Fk−1)=dk(Δk−dk)≤Δkdk\operatorname{Var}(\varepsilon_k \mid \mathcal F_{k-1}) = d_k(\Delta_k - d_k) \le \Delta_k d_k. If s^k−1\hat s_{k-1} lies on the grid of spacing Δk\Delta_k, which is the case unless yky_k has just crossed into a coarser binade, then dk=xk mod Δk≤xkd_k = x_k \bmod \Delta_k \le x_k. Therefore Var⁡(εk∣Fk−1)≤2u xk yk\operatorname{Var}(\varepsilon_k\mid\mathcal F_{k-1}) \le 2u\,x_k\,y_k. Taking expectations, and using unbiasedness, E[yk]=E[s^k−1]+xk=sk\mathbb E[y_k] = \mathbb E[\hat s_{k-1}] + x_k = s_k, so

∑kE[Var⁡(εk∣Fk−1)]  ≤  2u∑kxksk  =  u(S2+∑kxk2),\sum_k \mathbb E\bigl[\operatorname{Var}(\varepsilon_k\mid\mathcal F_{k-1})\bigr] \;\le\; 2u\sum_k x_k s_k \;=\; u\Bigl(S^2 + \sum_k x_k^2\Bigr),

by the identity 2∑kxksk=S2+∑kxk22\sum_k x_k s_k = S^2 + \sum_k x_k^2. At the at most BB binade crossings we use only Var⁡≤Δk2/4≤u2yk2\operatorname{Var} \le \Delta_k^2/4 \le u^2 y_k^2. Since E[yk2]=sk2+Var⁡(s^k−1)≤S2(1+O(u))\mathbb E[y_k^2] = s_k^2 + \operatorname{Var}(\hat s_{k-1}) \le S^2(1 + O(u)) by what has already been shown, R≤(1+o(1)) B u2S2R \le (1+o(1))\,B\,u^2 S^2. □\square

The variance of a stochastic rounding is not of order u2y2u^2y^2 but of order u x yu\,x\,y: it is proportional to the increment, because a small increment is rounded up only rarely. The variances add up to a multiple of ∑xksk\sum x_k s_k, which is of order S2S^2, instead of growing with NN.

Theorem 2 is an upper bound, and it should be read as one. It does not say what the error is; it says what the root-mean-square error cannot exceed. Nor does it make stochastic rounding accurate. Its guarantee is of order u\sqrt u, which for binary16 is 0.0220.022, about 45 times the unit roundoff u=4.9×10−4u = 4.9\times10^{-4}. Stochastic rounding prevents stagnation. It does not deliver working precision.

Line chart of relative error of a sum against number of increments, both log scale, with interquartile bands. Round to nearest grows from 0.003 to 0.98 and stagnates. Stochastic rounding stays between 0.003 and 0.013, below a dashed line at the square root of u. Kahan compensated summation and pairwise summation stay between 2 and 4 times 10 to the minus 4, below the unit roundoff. Fig. 4 — Summing NN increments of about 10−310^{-3} with an 11-bit significand; medians and interquartile ranges over 100 runs. Round-to-nearest stagnates; stochastic rounding stays below its bound u\sqrt u but far above the unit roundoff; compensated and pairwise summation stay at working precision.

Figure 4 adds the two classical remedies, both computed with every operation rounded to the same 11-bit significand. Over 100 runs, the relative error of stochastic rounding had a median between 3.2×10−33.2\times10^{-3} and 1.3×10−21.3\times10^{-2} and a root-mean-square value between 5.5×10−35.5\times10^{-3} and 1.9×10−21.9\times10^{-2}, within the bound of Theorem 2 at every NN. Kahan’s compensated summation (Kahan, 1965) had a median error between 2.1×10−42.1\times10^{-4} and 2.8×10−42.8\times10^{-4}, below the unit roundoff, and pairwise summation (Higham, 1993) between 2.5×10−42.5\times10^{-4} and 4.0×10−44.0\times10^{-4}. At N=218N = 2^{18} stochastic rounding was 46 times less accurate than Kahan summation. Where a low-precision accumulator cannot be avoided, compensated or pairwise summation is the first remedy, and stochastic rounding is for hardware or algorithms where those are not available.

When the error criterion is the wrong criterion

Everything above compares rounding error with estimation error, or with true turnover. For several common computations that comparison is not the relevant one, and binary64, sometimes more, remains the right choice.

  • Reproducibility and audit. A backtest, a risk report or a regulatory calculation may have to reproduce bit for bit, or within a stated tolerance, across machines, library versions and years. Lower precision does not make results less reproducible in principle, but it makes every source of non-reproducibility (summation order, threading, fused multiply–add) larger by the ratio of the unit roundoffs, which is 2292^{29} between binary32 and binary64.
  • Finite-difference sensitivities and Greeks. A central difference with step hh has truncation error of order h2h^2 and rounding error of order u/hu/h; the best achievable relative accuracy is of order u2/3u^{2/3}. That is about 10−510^{-5} in binary32 and 6×10−36\times10^{-3} in binary16, before any further amplification. Second differences, as for gamma, fare worse.
  • Differences of nearly equal quantities. Marginal risk contributions, the risk of a proposed trade, or the comparison of two portfolios that differ in a few names are differences between large, almost equal numbers. The relevant scale is the difference, not the level, and the statistical errors of the two terms largely cancel while their rounding errors do not. This is the turnover argument again, in another form.
  • Long chained computations. Simulations, recursions and iterative calibrations accumulate rounding error with the number of steps, not with the amount of data (the previous section is one example). Their precision budget is set by the chain length.

For these, the question is not “is the rounding error small compared with the estimation error?” but “is it small compared with the quantity that is actually used?” The answer can easily be no in binary32.

What changes on Monday

If you build risk models or portfolios, four things follow, all subject to the evidence being synthetic.

First, for covariance linear algebra whose result is used once, such as a one-off risk estimate or a research study, binary32 is ample, and 16-bit formats are adequate only with correlation scaling, n/Tn/T small, and a history short enough for the single-estimate budget.

Second, for anything re-estimated and traded daily, neither 16-bit format is adequate without refinement: in our synthetic markets binary16 added 7% to 60% to turnover and bfloat16 more than doubled it. Binary32 added about one part in ten thousand. If the hardware favours a low-precision factorization, refine the solve with residuals in at least binary32.

Third, keep binary64, or better, where the error criterion is the wrong criterion: reproducible backtests and audits, finite-difference sensitivities, differences of nearly equal quantities, and long chained computations. For covariance linear algebra outside those cases, binary32 is a defensible default; binary64 there buys reproducibility and comfort rather than accuracy.

Fourth, treat accumulations separately. A sum over millions of terms is not protected by statistics. Use pairwise or compensated summation.

What this does not show

All laws in this article are empirical observations on synthetic markets: Gaussian, Student-t and regime-switching returns generated from a five-factor model with known covariance. They have not been measured on real return data, where non-stationarity also changes what “true” covariance means.

The rolling-window experiment covers n≤100n \le 100, two window lengths and one market structure. The form C′uTC'uT is supported over five orders of magnitude of uu, but its constant may depend on nn and on the factor structure in ways three configurations cannot reveal, and turnover in practice is filtered by trading rules that we did not model.

Conjecture 1 is supported for n/T≤0.2n/T \le 0.2. It fails, as the alignment measurements say it should, as n/Tn/T approaches one, and it is unproven.

Only one shrinkage estimator was tested, at the small intensities it chooses when n/T≤0.1n/T \le 0.1. Mean–variance portfolios, which add the much larger estimation error of expected returns (the effect Michaud, 1989, called the optimization enigma), were not studied.

The speed measurements come from one CPU and one library. They show that low precision is not automatically faster, not that it never is; GPUs and other libraries were not tested.

References

  • Carson, E. and Higham, N. J. (2018). Accelerating the solution of linear systems by iterative refinement in three precisions. SIAM Journal on Scientific Computing, 40(2), A817–A847.
  • Connolly, M. P., Higham, N. J. and Mary, T. (2021). Stochastic rounding and its probabilistic backward error analysis. SIAM Journal on Scientific Computing, 43(1), A566–A585.
  • Higham, N. J. (1993). The accuracy of floating point summation. SIAM Journal on Scientific Computing, 14(4), 783–799.
  • Higham, N. J. (2002). Accuracy and Stability of Numerical Algorithms, 2nd ed. SIAM.
  • Higham, N. J. and Mary, T. (2019). A new approach to probabilistic rounding error analysis. SIAM Journal on Scientific Computing, 41(5), A2815–A2835.
  • IEEE (2008). IEEE Standard for Floating-Point Arithmetic, IEEE Std 754-2008.
  • Kahan, W. (1965). Further remarks on reducing truncation errors. Communications of the ACM, 8(1), 40.
  • Ledoit, O. and Wolf, M. (2004). A well-conditioned estimator for large-dimensional covariance matrices. Journal of Multivariate Analysis, 88(2), 365–411.
  • Marchenko, V. A. and Pastur, L. A. (1967). Distribution of eigenvalues for some sets of random matrices. Mathematics of the USSR-Sbornik, 1(4), 457–483.
  • Michaud, R. O. (1989). The Markowitz optimization enigma: is “optimized” optimal? Financial Analysts Journal, 45(1), 31–42.
  • Wilkinson, J. H. (1963). Rounding Errors in Algebraic Processes. Prentice-Hall.

Code and data. All numbers and figures in this article come from experiments.py (Python 3.9, numpy 2.0), which runs in under two minutes on a laptop (about 20 seconds more with the optional timing benchmark) and writes results.json. Seeds are fixed; every stochastic experiment uses at least 50 samples, and the summation experiment 100.

Revised 11 November 2026. This version replaces 12-sample tables with 50-sample medians and interquartile ranges, corrects the statement of how much precision binary64 carries beyond what the data can use, and adds the sections on rolling re-estimation and turnover, robustness, the exponent range, and the cases where binary64 should be kept. It also adds compensated and pairwise summation to the summation experiment and replaces implied speed claims with a measured benchmark.

Tags — floating point, rounding error analysis, mixed precision, stochastic rounding, covariance estimation, portfolio optimization, turnover