Boost.Multiprecision alternatives and similar libraries
Based on the "Math" category.
Alternatively, view Boost.Multiprecision alternatives based on common mentions on social networks and blogs.
-
Eigen
A high-level C++ library of template headers for linear algebra, matrix and vector operations, numerical solvers and related algorithms. [MPL2] -
TinyExpr
tiny recursive descent expression parser, compiler, and evaluation engine for math expressions -
MIRACL
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC). -
ExprTK
C++ Mathematical Expression Parsing And Evaluation Library https://www.partow.net/programming/exprtk/index.html -
linmath.h
a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions -
NT2
DISCONTINUED. A SIMD-optimized numerical template library that provides an interface with MATLAB-like syntax. [Boost] -
LibTomMath
LibTomMath is a free open source portable number theoretic multiple-precision integer library written entirely in C. -
Xerus
A general purpose library for numerical calculations with higher order tensors, Tensor-Train Decompositions / Matrix Product States and other Tensor Networks -
SLIMCPP
Simple Long Integer Math for C++. Lightweight cross-platform header-only library what implements big integer arithmetic in С++17. -
Mission : Impossible (AutoDiff)
A concise C++17 implementation of automatic differentiation (operator overloading) -
Armadillo
A high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use. The syntax (API) is deliberately similar to Matlab. [MPL2] -
GMP
A C/C++ library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. [LGPL3 & GPL2]
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Boost.Multiprecision or a related project?
README
Boost Multiprecision Library
ANNOUNCEMENT: Support for C++11 will be deprecated in this library starting in July 2023 (Boost 1.82).
New features will require at least C++14, as will existing features starting with the deprecation release.
Master | Develop | |
---|---|---|
Drone | ||
Github Actions |
The Multiprecision Library provides integer, rational, floating-point, complex and interval number types in C++ that have more range and precision than C++'s ordinary built-in types. The big number types in Multiprecision can be used with a wide selection of basic mathematical operations, elementary transcendental functions as well as the functions in Boost.Math. The Multiprecision types can also interoperate with the built-in types in C++ using clearly defined conversion rules. This allows Boost.Multiprecision to be used for all kinds of mathematical calculations involving integer, rational and floating-point types requiring extended range and precision.
Multiprecision consists of a generic interface to the mathematics of large numbers as well as a selection of big number back ends, with support for integer, rational and floating-point types. Boost.Multiprecision provides a selection of back ends provided off-the-rack in including interfaces to GMP, MPFR, MPIR, TomMath as well as its own collection of Boost-licensed, header-only back ends for integers, rationals, floats and complex. In addition, user-defined back ends can be created and used with the interface of Multiprecision, provided the class implementation adheres to the necessary concepts.
Depending upon the number type, precision may be arbitrarily large (limited only by available memory), fixed at compile time (for example 50 or 100 decimal digits), or a variable controlled at run-time by member functions. The types are expression-template-enabled for better performance than naive user-defined types.
The full documentation is available on boost.org.
Standalone
Defining BOOST_MP_STANDALONE allows Boost.Multiprecision to be used with the only dependency being Boost.Config. Our package on this page already includes a copy of Boost.Config so no other donwloads are required. Some functionality is reduced in this mode. A static_assert message will alert you if a particular feature has been disabled by standalone mode. Boost.Math standalone mode is compatiable, and recommended if special functions are required for the floating point types.
Support, bugs and feature requests
Bugs and feature requests can be reported through the Gitub issue tracker (see open issues and closed issues).
You can submit your changes through a pull request.
There is no mailing-list specific to Boost Multiprecision, although you can use the general-purpose Boost mailing-list using the tag [multiprecision].
Development
Clone the whole boost project, which includes the individual Boost projects as submodules (see boost+git doc):
git clone https://github.com/boostorg/boost
cd boost
git submodule update --init
The Boost Multiprecision Library is located in libs/multiprecision/
.
Running tests
First, build the B2 engine by running bootstrap.sh
in the root of the boost directory. This will generate B2 configuration in project-config.jam
.
./bootstrap.sh
Now make sure you are in libs/multiprecision/test
. You can either run all the tests listed in Jamfile.v2
or run a single test:
../../../b2 <- run all tests
../../../b2 test_complex <- single test
*Note that all licence references and agreements mentioned in the Boost.Multiprecision README section above
are relevant to that project's source code only.