News:
March, 2016:
A new package is available for multiple-precision exact rational | |
arithmetic. See below for a link to a page for the files that define | |
the package. Many of the other files here have changed, with some | |
new code to support the rational arithmetic routines. | |
Several files on the sample program page have also changed. |
July, 2015:
Some changes have been made to FM to support programs that need | |
64-bit integer arithmetic. This version works with either 64-bit or | |
32-bit integers. | |
This version can be useful even for programs that don't need 64-bit | |
integers if having extended FM over/underflow thresholds is useful. | |
See the "Installing the FM package" section of file FM_User_Manual.txt | |
below for more details. |
May, 2015:
Minor changes to FM.f95 have been made that can speed up the gamma | |
function in some cases. Other functions that use gamma, such as | |
factorial, binomial coefficients, beta, and incomplete gamma, can | |
also be faster. |
August, 2014:
A new subroutine for high-precision numerical solution of | |
differential equations has been added to the sample program page. | |
It uses a 14th-order Runge Kutta method. |
July, 2014:
A new package for FM interval arithmetic is available. | |
See below for a paper describing the package and giving several | |
examples using interval arithmetic, and the link to a page for the | |
files that define the package. |
June, 2014:
A few minor changes have been made to FMZM90.f95. | |
Functions DOT_PRODUCT, MATMUL, PRODUCT, and SUM | |
can now return correct results in a few cases where some | |
input values are very large or small and the previous version | |
encountered overflow or underflow and gave unknown. |
January, 2013:
A few minor changes have been made to FM.f95. | |
Some unused variables have been removed, and some new code for | |
exception-handling in the complex arithmetic versions of exp, sin, | |
cos, sinh, and cosh can now return overflowed results where the | |
previous version gave unknown. |
July, 2011:
Some new routines and programs for multiple-precision integration | |
have been added to the sample program page. |
May, 2011:
Version 1.3b of the FM package (April, 2011) is now available here. | |
This is an update of version 1.3 as described in the TOMS 2011 paper. | |
New features in this version: | |
Many of the elementary and special functions are faster than the versions in 1.2 or 1.3. | |
New Fortran-08 functions have been added: |
acosh(x), asinh(x), atanh(x) -- real and complex | |
bessel_j0(x), bessel_j1(x), bessel_jn(n,x) -- standard names for existing functions | |
bessel_y0(x), bessel_y1(x), bessel_yn(n,x) | |
bessel_jn(n1,n2,x), bessel_yn(n1,n2,x) | |
erfc_scaled(x) | |
atan(x,y) -- name for atan2(x,y) | |
hypot(x,y) -- for sqrt( x^2 + y^2 ) | |
norm2(a) -- for sqrt( a(1)^2 + a(2)^2 + ... + a(n)^2 ) |
February, 2011:
This is a major revision of the FM package. | |
The code on the ACM web site is version 1.3 of FM (June, 2010). | |
This version of the FM package is described in a paper appearing in | |
Transactions on Mathematical Software 37 (February, 2011) 1 -- 18. | |
New functions in this version: |
bessel_j(n,x), bessel_y(n,x) | |
cos_integral(x), sin_integral(x) | |
cosh_integral(x), sinh_integral(x) | |
erf(x), erfc(x), log_erfc(x) | |
exp_integral_ei(x), exp_integral_en(n,x) | |
fresnel_c(x), fresnel_s(x) | |
log_integral(x) |
New features in this version: |
Array syntax for the three multiple precision derived types. | |
Support for much higher precision. | |
Perfect rounding is now default. | |
Use of undefined multiple-precision variables is detected. |
The package performs multiple-precision real, complex, and integer arithmetic.
It provides the intrinsic Fortran numerical functions, as well as many special functions that are
not included in the Fortran standard.
In addition to these three basic arithmetic types, multiple-precision exact rational arithmetic
and interval arithmetic are also available.
One of the primary uses of the package is to study the accuracy and stability of numerical
algorithms by comparing results computed with several different levels of precision.
An existing Fortran program can be checked by converting it from double precision
to FM arithmetic. The package is designed to make this conversion fairly easy.
The precision, base, and rounding mode for the arithmetic can be set by the user.
Functions are available for conversion between multiple-precision numbers and machine-precision
numbers (single and double precision real and complex, and integer types). Mixed-mode operations
involving multiple-precision numbers and machine-precision numbers are handled automatically in
statements such as a = b - 1 or y = x/3.
There are functions for input/output operations and output formatting. Formatting functions are
very similar to Fortran's format specifications.
The package also has routines for integer multiple-precision arithmetic and functions, including
GCD, modular products and powers, and a random number generator based on 49-digit primes.
Array syntax works like Fortran's array operations in statements like v = 1, a = b + c, and
y = cos(x) when these variables are vectors or matrices of multiple precision numbers.
The program SampleFM.f95 below shows several examples of using FM for high-precision real,
complex, and integer calculations.
Click a given file. If you directly download it, there may be an extra ".txt" filetype at the
end of the file name. Delete it. (You might also have to change "f95" to "f90" or something
else, depending on your compiler.)
FM.f95
Subroutine library for multiple-precision operations. 64,677 lines of code
FMZM90.f95
Module for derived type interfaces. 47,960 lines of code
FMSAVE.f95
Module for FM internal global variables. 488 lines of code
TestFM.f95
Test program that checks a few operations for all of the FM routines. 43,962 lines of code
SampleFM.f95
Small sample program using FM. 893 lines of code
SampleFM.chk
Expected output file from SampleFM.f95. 157 lines
FM_User_Manual.txt
User's Guide for the package, along with a list of the files, some troubleshooting advice,
and an example set of compiler/linker commands for building the programs. 2,527 lines
All of these are technical papers explaining the algorithms used by the multiple-precision
package, except the last one.
"Using Multiple-Precision Arithmetic" gives some samples and discusses the package
from a user's point of view.
Efficient Multiple-Precision Evaluation of Elementary Functions
Mathematics of Computation 52 (1989) 131 -- 134
A Fortran Package For Floating-Point Multiple-Precision Arithmetic
Transactions on Mathematical Software 17 (1991) 273 -- 283
A Multiple-Precision Division Algorithm
Mathematics of Computation 66 (1996) 157 -- 163
Multiple Precision Complex Arithmetic and Functions
Transactions on Mathematical Software 24 (1998) 359 -- 367
Multiple-Precision Gamma Function and Related Functions
Transactions on Mathematical Software 27 (2001) 377 -- 387
Multiple-Precision Exponential Integral and Related Functions
Transactions on Mathematical Software 37 (2011) 1 -- 18
A Multiple-Precision Interval Arithmetic Package
http://myweb.lmu.edu/dmsmith/FMLIB.html (2014) 1 -- 13
Using Multiple-Precision Arithmetic
Computing in Science and Engineering 5 (July, 2003) 88 -- 93
Efficient Multiple-Precision Evaluation of Elementary Functions
Mathematics of Computation 52 (1989) 131 -- 134
Page 1,
2,
3,
4
A Fortran Package For Floating-Point Multiple-Precision Arithmetic
Transactions on Mathematical Software 17 (1991) 273 -- 283
Page 1,
2,
3,
4,
5,
6,
7,
8,
9,
10
A Multiple-Precision Division Algorithm
Mathematics of Computation 66 (1996) 157 -- 163
Page 1,
2,
3,
4,
5,
6,
7,
8
Multiple Precision Complex Arithmetic and Functions
Transactions on Mathematical Software 24 (1998) 359 -- 367
Page 1,
2,
3,
4,
5,
6,
7,
8,
9,
10
Multiple-Precision Gamma Function and Related Functions
Transactions on Mathematical Software 27 (2001) 377 -- 387
Page 1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11
Multiple-Precision Exponential Integral and Related Functions
Transactions on Mathematical Software 37 (2011) 1 -- 18
Page 1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19
Using Multiple-Precision Arithmetic
Computing in Science and Engineering 5 (July, 2003) 88 -- 93
Page 1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11
This page has the code for the FM rational arithmetic package,
along with several sample programs that use the package and a user's manual.
This page has the code for the FM interval arithmetic package,
along with several sample programs that use the package and a user's manual.
This page has a program that tries to automate most of the changes
needed to convert a normal Fortran program to a multiple-precision version using FM.
This page has a table of domains for FM functions.
This page has a table of times for FM functions.
This page has some example programs solving problems in root-finding,
linear systems of equations,
least-squares fitting, integrals, differential equations, derivatives for real and complex
functions, etc.