Support MPFR floats in numkondo

Remove '-D' option (error tolerance) in numkondo
This commit is contained in:
Ian Jauslin
2015-10-07 12:51:41 +00:00
parent e7aa6859f0
commit 469bdc8071
34 changed files with 890 additions and 120 deletions

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: April 14 2015 $
.Dt kondo_preprocess 1.3.1
.Dd $Mdocdate: September 22 2015 $
.Dt kondo_preprocess 1.4
.Os
.Sh NAME
.Nm kondo_preprocess

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: April 13 2015 $
.Dt meankondo 1.3.1
.Dd $Mdocdate: September 22 2015 $
.Dt meankondo 1.4
.Os
.Sh NAME
.Nm meankondo

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: June 12 2015 $
.Dt meantools-convert 1.3.1
.Dd $Mdocdate: September 22 2015 $
.Dt meantools-convert 1.4
.Os
.Sh NAME
.Nm meantools-convert

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: April 14 2015 $
.Dt meantools 1.3.1
.Dd $Mdocdate: September 22 2015 $
.Dt meantools 1.4
.Os
.Sh NAME
.Nm meantools
@ -19,6 +19,8 @@
.Nm
.Sy eval
.Op Fl R Ar values
.Op Fl P Ar precision
.Op Fl E Ar max_exponent
.Op Ar config_file
.Pp
.Sh DESCRIPTION
@ -136,6 +138,12 @@ The values of the rccs with which to evaluate the flow equation.
.Ar values
is formatted like an initial_condition (see
.Sx numkondo Ns (1) ) .
.It Fl P Ar precision
Number of bits used for the significand of numerical values (see
.Sx numkondo Ns (1) ) .
.It Fl E Ar max_exponent
Largest allowed value for the exponent of numerical values (see
.Sx numkondo Ns (1) ) .
.El
.Pp
.Sy Configuration file:

View File

@ -1,5 +1,5 @@
.Dd $Mdocdate: April 14 2015 $
.Dt numkondo 1.3.1
.Dd $Mdocdate: September 22 2015 $
.Dt numkondo 1.4
.Os
.Sh NAME
.Nm numkondo
@ -8,8 +8,9 @@
.Nm
.Op Fl F
.Op Fl N Ar niter
.Op Fl D Ar tolerance
.Op Fl I Ar initial_condition
.Op Fl P Ar precision
.Op Fl E Ar max_exponent
.Op Ar config_file
.Pp
.Nm
@ -44,12 +45,12 @@ as well as the following pre-processors, which generate configuration files for
Number of iterations
.It Fl F
Only print the last step of the computation, with full precision. The output can be used as an initial condition for further iterations.
.It Fl D Ar tolerance
If this option is provided, any number smaller than
.Ar tolerance
is set to 0.
.It Fl I Ar initial_condition
Set the initial condition from the command-line (overrides the initial condition in the configuration file). The format is the same as the '#!initial_configuration' entry, see below.
.It Fl P Ar precision
Number of bits used for the significand of numerical values (see the NUMERICAL PRECISION section). If this option is specified, then numerical values are represented as MPFR floats instead of long doubles, which requires more computating time.
.It Fl E Ar max_exponent
Largest allowed value for the exponent of numerical values (see the NUMERICAL PRECISION section). If this option is specified, then numerical values are represented as MPFR floats instead of long doubles, which requires more computating time.
.It Fl v
Print version information and exit.
.El
@ -145,6 +146,19 @@ If the '-F' flag is provided,
.Nm
prints the last step of the iteration to stdout in a format that can be re-used as an initial condition for subsequent iterations.
.Pp
.Sh NUMERICAL PRECISION
Numerical values are represented as floating point numbers, which consist in a significand (or mantissa) and an exponent. The number is given by
.D1 significand * 2^exponent
.Pp
If neither the '-P' nor the '-E' flags are specified, then numerical values are implemented using the 'long double' type, which allocates 64 bits to the significand and 15 to the exponent (this may change depending on the implementation of the C compiler used to compile
.Nm ) .
Numbers are therefore accurate to 19 decimal places, and the exponent must be in the interval [-16382 , 16383].
.Pp
If one of the '-P' or '-E' flags are specified, then numerical values are implemented using the GNU MPFR library. The number of bits allocated to the significand and exponent can be set by the '-P' and '-E' flags, within the limits set by the MPFR library. These values depend on the implementation of the library. On 64-bit systems, the maximal precision and maximal value of the exponent should be of the order of 2^63 and 2^62 respectively.
.Pp
Note that using MPFR floats increases the computing time required to run
.Nm
.Pp
.Sh RETURN CODE
.Nm
returns 0 on success and -1 on error.