A high-performance Delphi math library using SIMD assembly and approximate functions for multimedia and games.
FastMath is a Delphi library optimized for high-performance mathematical computations, leveraging hand-tuned assembly code and SIMD instructions to significantly outperform standard Delphi RTL math functions. It is designed for performance-critical applications like games and multimedia, where calculation speed often outweighs the need for perfect accuracy or extensive error checking. The library provides vector and matrix types with overloaded operators, as well as approximate functions prefixed with 'Fast' for dramatic speed gains.
Delphi developers building performance-intensive applications such as real-time games, multimedia software, and animation tools where mathematical computation speed is critical. It is also suitable for developers needing SIMD-accelerated vector and matrix operations across x86 and Arm platforms.
Developers choose FastMath for its substantial performance improvements—up to 90x faster for some operations—through SIMD optimization and approximate functions, while maintaining interoperability with Delphi's standard math types. Its cross-platform support and design philosophy prioritizing speed over exhaustive precision make it ideal for real-time interactive applications.
Fast Math Library for Delphi
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses SSE2 and NEON instructions to process vectors in parallel, achieving up to 90x faster operations like FastSinCos, as shown in detailed benchmarks across platforms.
Delivers significant performance improvements on x86-32/64, Arm32, and Arm64 architectures, with benchmarks showing consistent speedups for vector and matrix operations.
Types are memory-compatible with Delphi's standard math types like TPointF and TMatrix3D, allowing easy typecasting and conversion without data restructuring overhead.
Provides Fast-prefixed functions that trade minimal accuracy for massive speed gains, ideal for games and graphics where frame rate is a priority, as noted in the README.
Lacks support for double-precision floating-point arithmetic, limiting its use in applications requiring higher numerical accuracy, as admitted in the README.
The approximate Fast-functions sacrifice precision for speed, making them unsuitable for scientific or financial calculations where exact results are essential.
Optimal performance requires SSE2 or NEON support; while common, disabling it via FM_NOSIMD reduces benefits, and the iOS simulator uses unoptimized Pascal code.
Recommends disabling floating-point exceptions, which can mask errors by returning NaN or Infinity instead of raising exceptions, complicating debugging and error recovery.