MPFR

From Wikipedia, the free encyclopedia

MPFR
Developer: INRIA and others
Latest release: 2.2.1 / November 29, 2006
OS: Cross-platform
Use: Mathematical software
License: LGPL
Website: [1]

MPFR is a portable C library for arbitrary-precision binary floating-point computation with correct rounding, based on GNU Multi-Precision Library. The computation is both efficient and has a well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 standard for fixed-precision floating-point arithmetic. More precisely, its main features are:

  • Support for special numbers: signed zeroes, infinities and not-a-number (a single NaN is currently supported).
  • Each number has its own precision (in bits since MPFR uses radix 2). The floating-point results are correctly rounded to the precision of the target variable, in any of the four IEEE-754 rounding modes.
  • Supported functions: MPFR implements all mathematical functions from C99: the logarithm and exponential in natural base, base 2 and base 10, the log(1+x) and exp(x)-1 functions (log1p and expm1), the six trigonometric and hyperbolic functions and their inverses, the gamma, zeta and error functions, the arithmetic geometric mean, the power (xy) function. All those functions are correctly rounded over their complete range.
  • Subnormals are not supported, but can be emulated with the mpfr_subnormalize function.

MPFR is not able to track the accuracy of numbers in a whole program or expression; this is not its goal. Interval arithmetic packages like MPFI, or Real RAM implementations like iRRAM, which may be based on MPFR, can do that for the user.

[edit] External links