A Python library for computing accurate sums and dot products, mitigating floating-point errors in numerical computations.
Accupy is a Python library that provides accurate summation and dot product computations to mitigate floating-point rounding errors. It implements several high-precision algorithms like Kahan summation, Shewchuck's algorithm, and K-fold precision methods, addressing numerical instability in ill-conditioned problems. The library is particularly useful when standard NumPy functions produce inaccurate results due to digit cancellation or large condition numbers.
Scientific computing researchers, data scientists, engineers, and developers working with numerical algorithms where floating-point accuracy is critical, such as in computational geometry, financial modeling, or physics simulations.
Developers choose Accupy for its provably accurate algorithms that guarantee higher precision than standard Python/NumPy functions, along with tools for condition number analysis and ill-conditioned problem generation. It fills a niche for numerical stability without requiring arbitrary-precision arithmetic.
:dart: Accurate sums and dot products for Python.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements Shewchuck's fsum algorithm, which guarantees accurate summation up to the last digit, as demonstrated in accuracy comparisons where it outperforms naive methods for ill-conditioned sums.
Offers Kahan summation, fsum, and adjustable K-fold precision (ksum), allowing users to balance accuracy and performance based on their specific numerical stability needs.
Provides functions to compute condition numbers for sums and dot products, helping users assess numerical stability and identify potential error sources before relying on results.
Includes tools to generate ill-conditioned test cases with specified condition numbers, useful for validating algorithms and educational demonstrations of floating-point errors.
Runtime comparisons in the README show that accupy's methods, especially fsum, are much slower than NumPy's optimized functions, making it unsuitable for speed-critical applications.
Requires the Eigen C++ library for installation, which adds setup hurdles and may not be available in all Python environments, limiting portability and ease of use.
Focused solely on summation and dot products, lacking support for other numerical operations like matrix multiplication or integration that might also benefit from high-precision computations.