Multiprecision Computing Toolbox for MATLAB

The Multiprecision Computing Toolbox is the MATLAB extension for computing with arbitrary precision.

The toolbox equips MATLAB with a new multiple precision floating-point numeric type and extensive set of mathematical functions that are capable of computing with arbitrary precision.

The multiprecision numbers and matrices can be seamlessly used in place of the built-in double entities following standard MATLAB syntax rules. As a result, existing MATLAB programs can be converted to run with arbitrary precision with minimal changes to source code.

Quadruple precision computations (compliant with IEEE 754-2008) are supported as a special case.


Toolbox provides a comprehensive library of computational routines covering the following areas:

  • Real and complex numbers, dense and sparse matrices, multidimensional arrays
  • Elementary mathematical functions and constants
  • Solvers for linear system of equations (including sparse solvers)
  • Matrix analysis functions and factorizations
  • Eigenvalues and eigenvectors (including generalized problem)
  • Singular value decomposition
  • Numerical integration (including full set of Gaussian quadrature)
  • Optimization and polynomials
  • Ordinary differential equations solvers
  • Data analysis and Fourier transform
  • Number theory functions
  • Special functions

Please visit the Function Reference page for a complete list of supported functions.


Toolbox outperforms famous competitors by a large margin. Timing comparison of various decomposition types of a dense matrices:

Small matrix factorization in quadruple precision (100×100, 34 digits)
Factorization Timing (sec)Speed-up (times)
MATLAB (VPA) MapleAdvanpixOver VPAOver Maple
A & B are pseudo-random real matrices (100×100):
[L,U] = lu(A) 1.67 0.610.0278.26 28.29
[Q,R] = qr(A) 3.46 2.600.0844.44 33.46
[U,S,V] = svd(A) 30.8520.990.30101.6669.17
S = svd(A) 15.882.510.07223.5435.35
[V,D] = eig(A) 57.2529.540.7279.20 40.86
lambda = eig(A) 21.2126.900.3462.31 79.01
[V,D] = eig(A,B) n/a55.431.2843.10
lambda = eig(A,B) n/a33.540.8240.90
Large matrix factorization in quadruple precision (500×500, 34 digits)
Factorization Timing (sec)Speed-up (times)
MATLAB (VPA) MapleAdvanpixOver VPAOver Maple
A & B are pseudo-random real matrices (500×500):
[L,U] = lu(A) 249.13 85.160.89281.1296.10
[Q,R] = qr(A) 514.34 458.863.04169.15150.90
[U,S,V] = svd(A) 5595.26 4317.4013.83404.48312.10
S = svd(A) 2765.11 645.607.47370.2086.43
[V,D] = eig(A) 21806.30 6060.9055.57392.40109.06
lambda = eig(A) 3384.58 7822.3028.43119.07275.19
[V,D] = eig(A,B) n/a 11358.00123.1892.21
lambda = eig(A,B) n/a 5273.0065.1580.94

Detailed comparisons: large dense matrices, small dense matrices, direct sparse solvers and basic array operations.


The two plots below show the eigenvalues of the Grcar matrix computed by MATLAB and by the toolbox, respectively.

The eigenvalues of the Grcar matrix are displayed in black, and the eigenvalues of the transposed matrix – in red. In theory they should coincide:

Grcar matrix eigenvalues in double precision
Figure 1. MATLAB is unable to generate accurate results using the double precision.
Grcar matrix eigenvalues in quadruple precision
Figure 2. Correct eigenvalues computed with quadruple precision by the toolbox. See more details…


The toolbox removes MATLAB’s inherent limitation on computing precision, thus enabling the user to solve a variety of important problems previously impossible to handle with MATLAB:

  • Allows solving of numerically unstable problems (e.g. computing eigenvalues or solving ill-conditioned matrices).
  • Enables checking of accuracy of results by re-running existing MATLAB programs in extended precision.
  • Minimizes rounding and cancellation errors in computations (e.g. summation of series with alternating signs).
  • Allows computing of reference constants and coefficients of algorithms with high accuracy.

Key Features

  • Comprehensive set of mathematical functions. Multiprecision Computing Toolbox supplies arbitrary-precision analogs to the majority of the functions listed in the famous MATLAB Top 500, from simple arithmetic operations to advanced numerical algorithms (e.g. fft, eig, svd, quadgk, ode45, etc.), and adds original functionality not available in MATLAB. Please visit the Function Reference page for a complete list of supported routines.
  • Easy porting of existing MATLAB programs to arbitrary precision.
    The Toolbox employs an operator overloading technique which allows easy porting of pre-existing programs to arbitrary precision – with little or no modifications to the source code. In most cases the conversion is automatic, and no extra action is required by the user. For further examples, visit Arbitrary precision Gauss-Legendre Quadrature, Gauss-Kronrod Quadrature.
  • Algorithms. Multiprecision Computing Toolbox stands on the shoulders of giants – we implement only state-of-the-art algorithms designed for parallelism and high-performance. Usually we convert algorithms from LAPACK to precision-independent C++ code with various optimizations for vector and multi-core execution.

    Every routine in toolbox is a meta-algorithm, which analyses the input matrix and applies best suitable method for its type (symmetric/Hermitian, positive definite, triadiagonal, band, triangular, etc.). Thus, for example, we use multi-shift QR for unsymmetric eigen-decomposition whereas symmetric/Hermitian or tridiagonal problems are solved by MRRR or Divide & Conquer algorithms.

    We rely on and contribute to the following open source libraries: GMP/MPIR, MPFR, MPFR C++, MPC LAPACK, Eigen and Trilinos.

  • High-performance. Our product is developed using compiled programming languages C/C++ and Assembler with only a thin M-file interface for smooth integration to MATLAB. Toolbox is specifically optimized for parallel execution on multi-core CPU.
  • Ease of access and user-friendliness.
    We provide comprehensive instructions and step-by-step installation help, making it easy to install and use the Multiprecision Computing Toolbox. Both 32-bit and 64-bit versions are available for GNU Linux, Microsoft Windows, and Apple Mac OS X. The Quick Start User’s Manual, Function Reference, and our frequently updated Blog provide examples, tips, and announcements about our product.

Supported OS: Windows, Mac OSX and GNU Linux

We encourage inquiries – please contact us with any questions, suggestion, or other feedback.