|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
Scalar reference implementation of the beta batch kernel. More...
#include "simd_batch_detail.hpp"#include "momentum/momentum.hpp"#include <cmath>#include <algorithm>Go to the source code of this file.
Namespaces | |
| namespace | srfm |
| namespace | srfm::simd |
| namespace | srfm::simd::detail |
Functions | |
| void | srfm::simd::detail::compute_beta_scalar (const double *__restrict__ velocities, std::size_t n, double &running_max, double *__restrict__ out) noexcept |
| Scalar reference implementation of the beta batch kernel. | |
Variables | |
| static constexpr double | srfm::simd::detail::BETA_CLAMP_LIMIT |
Scalar reference implementation of the beta batch kernel.
Module: src/simd/ Owner: AGT-08 — 2026-03-01
Using the maximum of the entire batch as the denominator allows all SIMD variants to produce bit-identical results: AVX-512, AVX2, and scalar all compute the same running_max and perform identical divisions. Element-wise running_max updates introduce a serial dependency that breaks SIMD parallelism AND causes different betas depending on vector width.
Correctness: beta_i = |v_i| / running_max ≤ 1.0 because running_max ≥ batch_max ≥ |v_i|. The invariant beta_i ∈ [0, BETA_MAX_SAFE) is always preserved.
Definition in file beta_scalar.cpp.