Show HN: Fast-posit, sw implementation of posit arithmetic in Rust (github.com)

🤖 AI Summary
fast-posit is a work-in-progress Rust crate that implements the Posit number format (Gustafson, standardized 2022) and its quire accumulator. The project prioritizes correctness, performance, and readability: it aims to fully implement the posit standard (and extensions such as arbitrary posit and quire sizes), provide correctly rounded elementary functions, and ship extensive tests that validate results against an arbitrary-precision oracle. Posits offer advantages over IEEE-754 — higher accuracy/dynamic range for a given bit count, simple deterministic rounding with bounded error, tapered precision near ±1, no subnormals or signed zeros, and compact NaN handling — making them attractive for ML and HPC workloads where reproducibility and mixed precision matter. Technically, fast-posit supports configurable widths (any bit width ≥2 and exponent width ≤ bit width), standard convenience types (p8/p16/p32/p64) and generic Posit<N,ES,...> types, full arithmetic, comparisons, conversions, elementary functions, and a quire for exact accumulation and parallel-safe dot products. The crate is no_std-compatible, dependency-free, and comes with benchmarks (70–350 Mops/s on an 11th-gen Intel core; roughly 4–20× slower than native FPU, varying by operation) and optional feature flags to compare against cerlane-softposit and berkeley-softfloat. The implementation is optimized yet documented for learning and inspection, making it useful both as a research/production building block and a reference software posit implementation.
Loading comments...
loading comments...