Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
gamma_scalar.cpp File Reference

Scalar reference implementation of the gamma batch kernel. More...

#include "simd_batch_detail.hpp"
#include "momentum/momentum.hpp"
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  srfm
 
namespace  srfm::simd
 
namespace  srfm::simd::detail
 

Functions

void srfm::simd::detail::compute_gamma_scalar (const double *__restrict__ betas, std::size_t n, double *__restrict__ out) noexcept
 Scalar reference implementation of the gamma batch kernel.
 

Variables

static constexpr double srfm::simd::detail::BETA_CLAMP_LIMIT
 

Detailed Description

Scalar reference implementation of the gamma batch kernel.

Module: src/simd/ Owner: AGT-08 — 2026-03-01

Responsibility

Compute gamma_i = 1.0 / sqrt(1.0 - betas[i]^2) for all i in [0, n). This is the authoritative reference implementation. All SIMD variants must produce results within 1 ULP of the scalar path for any valid input.

Correctness Notes

• Input betas are expected to be in [0, BETA_MAX_SAFE) — the same range accepted by BetaVelocity::make(). • A defensive clamp to BETA_CLAMP_LIMIT is applied before the sqrt to ensure the argument of sqrt is strictly positive even in edge cases. • gamma ≥ 1.0 for all valid betas; the result is always finite.

Definition in file gamma_scalar.cpp.