Mailing-list for users and developers. Note: to post to the list, you cannot use the web interface, just send a mail to mpfr at inria.fr (and please, for a new thread, do not reply to an existing message; changing the subject is not sufficient).
The MPFR library is a C library for
multiple-precision floating-point computations with correct rounding.
MPFR has continuously been supported by the
INRIA and the current main
authors come from the
Caramba
and AriC project-teams at
Loria
(Nancy, France) and
LIP
(Lyon, France) respectively; see more on the
credit page.
MPFR is based on the
GMP
multiple-precision library.
The main goal of MPFR is to provide a
library for multiple-precision floating-point computation which is both
efficient and has a well-defined semantics. It copies the good ideas from
the ANSI/IEEE-754 standard for
double-precision floating-point arithmetic (53-bit significand).
MPFR is free. It is distributed under
the GNU
Lesser General Public License (GNU Lesser
GPL), version3 or later (2.1 or later for
MPFR versions until 2.4.x).
The library has been registered in France by the
Agence de Protection des Programmes
under the number IDDNFR00112002000RP200000010800, on 15March2000.
This license guarantees your freedom to share and change
MPFR, to make sure
MPFR is free for all its users. Unlike the
ordinary General Public License, the Lesser GPL enables
developers of non-free programs to use MPFR
in their programs. If you have written a new function for
MPFR or improved an existing one, please
share your work!
Extensions
The multiple-precision arithmetic is very useful for
interval arithmetic.
Get a multiple-precision interval arithmetic library
MPFI,
based on MPFR.
This library MPFI is developed by
Nathalie Revol from the
AriC
project and Fabrice Rouillier.
MPFI implements a subset of the mathematical
functions provided by MPFR. Read
more
explanations on Nathalie Revol's software page.
The
GNU MPC library,
a library for multiple-precision complex arithmetic with correct rounding,
based on the MPFR and
GMP
libraries.
Arpra,
an arbitrary-precision range analysis C library.
Interfaces for MPFR
The following C++ interfaces for MPFR,
very different in their design (and in particular, in the strategies
for intermediate precisions, so that they can yield different results), are
available:
MPFRCPP,
written by Alexey V. Beshenov. This interface uses a modern C++ design
with using of classes, templates and function objects.
Another
MPFR C++ wrapper,
written by Pavel Holoborodko. The precision of the temporary results in
an expression is chosen as the maximum precision of its arguments, and
the final result is rounded to the precision of the target variable.
The
mpfr::real
class, written by Christian Schneider.
It consists of a template class with precision and rounding mode passed
as template arguments. Hence, effectively a new type will be created for
each precision and rounding that is used. All the operators available
for fundamental floating point types as well as type conversions from
and to other types, and the set of mathematical functions known from
math.h/cmath are implemented. This should allow for an easy
substitution of, e.g., a double with the wrapper class in
most cases.
MPFR++,
developed in the AriC
project. Warning! The version currently available (2004-02-27) is not
up-to-date, is not compatible with the latest releases of
MPFR and has several bugs.
News from 2007-05-02: Changes have been done on this interface since,
but they are not published yet.
The
gmpfrxx
C++ interface for both GMP and
MPFR, written by Jon Wilkening.
The KDE calculator
Abakus by Michael Pyne
(supporting arbitrary precision thanks to MPFR
as of version 0.90).
AERN2,
a set of Haskell packages for exact real number computation:
aern2-mp
(multi-precision floats via MPFR) and
aern2-real
(exact real numbers via Cauchy sequences and MPFR).
The ALGLIB.NET project
implements multiple-precision linear algebra using
MPFR.
The APRON
library, dedicated to the static analysis of the numerical variables
of a program by Abstract Interpretation.
MCAS/libivl
(computational algebra and plot system / interval computations library), by
Mateusz Paprocki.
MetaLibm
(code generators for the math library and beyond).
MPACK
(multiple precision arithmetic
BLAS and
LAPACK), by Nakata Maho,
supports MPFR as of version 0.6.5
(2010-05-21).
The MPFRCX
library for the arithmetic of univariate polynomials over arbitrary precision
real (MPFR) or complex
(MPC) numbers, without control on the
rounding.
The mpfs
library, an experiment in stochastic lazy floating-point arithmetic, from
Keith Briggs. Note: mpfs-0.9 (last updated in 2006, and the
latest version at the time of writing [2018-09-25]) will not work unmodified
with recent MPFR versions.
MPFUN2015,
an arbitrary precision package by David H. Bailey; the MPFUN-MPFR
version is based on MPFR.
The CORE library:
a library for robust numerical and geometric computation.
The IBM Accurate Portable Mathlib library (2001), which provides correct rounding in double precision for rounding to nearest. It implements atan, atan2, asin, acos, exp, log, pow, sin, cos, tan, sqrt, remainder.
The RR class from
NTL,
which implements a smooth extension of IEEE
floating point to arbitrary precision and guarantees a platform-independent
behaviour.
Software developed in the old
Arnaire project and no longer maintained:
SCSLib,
a fast and lightweight multiple-precision library supporting the
four arithmetic operations; the precision (210 bits by default) is
fixed at compile time;
CRlibm,
a correctly rounded elementary function library (which has been
superseded by MetaLibm,
developed in other teams).
Sun's
libmcr, a correctly rounded library of basic double-precision
transcendental elementary functions.
The calc
calculator by Landon Curt Noll. This calculator implements a rational
arithmetic, with a fallback to some kind of multiple-precision fixed-point
arithmetic (integer multiplied by a configurable epsilon).