Interactive model — experiment with these parameters in sItô

IEEE single precision (float32) carries $24$ bits of significand [1]. At state magnitude $10^7$, adjacent representable float32 numbers are separated by $1$, so steps of size $0.1$ round identically to zero: a standard Brownian motion started at $10^7$ freezes completely, with terminal variance $0$ instead of $1$. At $10^6$, the grid spacing is $0.0625$ and rounding inflates the terminal variance by roughly $3\%$, whereas float64 recovers $1.00$ in both regimes.

Quantisation of diffusion increments

Near a magnitude $x$, float32 spacing lies between $6 \times 10^{-8} x$ and $1.2 \times 10^{-7} x$. Any increment smaller than half the local spacing vanishes under round-to-nearest [2]; larger increments snap to multiples of the spacing, injecting uniform quantisation noise of variance $\frac{h_{\mathrm{fp}}^2}{12}$ per step. For pure diffusion

$$ dX_t = \sigma\,dW_t $$

with $\sigma = 1$, $T = 1$, and $100$ steps ($\Delta = 0.01$), each Gaussian increment has standard deviation $\sigma\sqrt{\Delta} = 0.1$:

Initial level $X_0$float32 spacingRounding effectExact vs. float32 $\operatorname{Var}(X_1)$
$10^6$0.0625Snaps to grid, adding $\frac{0.0625^2}{12}$ per step1.00 vs. 1.03
$10^7$1Increments below $0.5$ round to zero1.00 vs. 0

Over $100$ steps at $10^6$, the accumulated quantisation variance is $100 \times \frac{0.0625^2}{12} = 0.033$, matching the observed $3\%$ inflation.

Flat zero variance line across t ∈ [0, 1] when simulating Brownian motion at x₀ = 10^7 in float32 Flat zero variance line across t ∈ [0, 1] when simulating Brownian motion at x₀ = 10^7 in float32
Time-evolution of empirical variance $\operatorname{Var}(X_t)$ in float32 starting at $X_0 = 10^7$ ($\sigma = 1$, $100$ steps): every increment rounds back to $X_0$, pinning the variance identically to $0$. Inspect float32 freeze in sItô ↗
Linear variance curve climbing smoothly from 0 to 1.002 at t = 1 when the same run uses float64 Linear variance curve climbing smoothly from 0 to 1.002 at t = 1 when the same run uses float64
Same Brownian run at $X_0 = 10^7$ switched to float64: increments stay intact across all $100$ steps, recovering the linear Brownian variance $\operatorname{Var}(X_t) = t$ ($1.002$ at $t = 1$). Inspect float64 run in sItô ↗

Run this in sItô

Open sItô with this model pre-loaded to inspect the path distribution, summary statistics, and parameter sensitivities—or change any setting and rerun (precision is selectable per run, defaulting to float32 unless set to float64):

RunPrecisionSimulated $\operatorname{Var}(X_1)$
$X_0 = 10^6$float321.04 (reference: 1.03, SE $1.4 \times 10^{-2}$)
$X_0 = 10^6$float641.00
$X_0 = 10^7$float320 (mean stays at $10^7$)
$X_0 = 10^7$float641.00

Avoiding precision loss

Single precision is safe whenever $\sigma\sqrt{\Delta} \gg 10^{-7} x$: an equity near $100$ moving by $1$ per step or an index at $10^4$ moving by $100$ suffers no rounding distortion. Precision fails when a large baseline—an epoch timestamp, cumulative counter, or uncentred state—is paired with small increments. Either simulate the centered deviation $y_t = x_t - 10^7$ in float32 or switch to float64. Step-size constraints are covered in Euler on a stiff mean reversion, precision and scheme selection in Using sItô, the compilation pipeline in Compiling parametric SDEs into fast Monte Carlo simulations, and precision speedups across CPU and GPU in CPU and GPU simulation performance.

Related notes: Phase diffusion in the van der Pol oscillator, Monte Carlo error versus discretization error.