(git:27c966b)
Loading...
Searching...
No Matches
double_double Module Reference

Double-double arithmetic: real and complex numbers stored as unevaluated sums hi + lo of two double-precision numbers, about 31 significant digits, following Y. Hida, X. S. Li, D. H. Bailey, Proc. 15th IEEE Symposium on Computer Arithmetic, 155 (2001). More...

Data Types

type  dd_type
 Double-double number hi + lo with |lo| <= ulp(hi)/2. More...
type  zdd_type
 Complex double-double number. More...

Functions/Subroutines

elemental type(dd_type) function, public dd_add (a, b)
 Sum of two double-double numbers.
elemental type(dd_type) function, public dd_sub (a, b)
 Difference of two double-double numbers.
elemental type(dd_type) function, public dd_mul (a, b)
 Product of two double-double numbers.
elemental type(dd_type) function, public dd_div (a, b)
 Quotient of two double-double numbers, by three steps of long division.
elemental type(zdd_type) function, public zdd (z)
 Complex double-double number from a double-precision one.
elemental complex(kind=dp) function, public zdd_to_dp (a)
 Rounds a complex double-double number to double precision.
elemental type(zdd_type) function, public zdd_add (a, b)
 Sum of two complex double-double numbers.
elemental type(zdd_type) function, public zdd_sub (a, b)
 Difference of two complex double-double numbers.
elemental type(zdd_type) function, public zdd_mul (a, b)
 Product of two complex double-double numbers.
elemental type(zdd_type) function, public zdd_div (a, b)
 Quotient of two complex double-double numbers.
elemental type(zdd_type) function, public zdd_conjg (a)
 Complex conjugate of a complex double-double number.
elemental real(kind=dp) function, public zdd_abs2 (a)
 Squared modulus of a complex double-double number, rounded to double precision.

Variables

type(zdd_type), parameter, public zdd_zero = zdd_type(dd_type(0.0_dp, 0.0_dp), dd_type(0.0_dp, 0.0_dp))
type(zdd_type), parameter, public zdd_one = zdd_type(dd_type(1.0_dp, 0.0_dp), dd_type(0.0_dp, 0.0_dp))
type(zdd_type), parameter, public zdd_i = zdd_type(dd_type(0.0_dp, 0.0_dp), dd_type(1.0_dp, 0.0_dp))

Detailed Description

Double-double arithmetic: real and complex numbers stored as unevaluated sums hi + lo of two double-precision numbers, about 31 significant digits, following Y. Hida, X. S. Li, D. H. Bailey, Proc. 15th IEEE Symposium on Computer Arithmetic, 155 (2001).

Note
The error-free transformations rely on IEEE double-precision rounding of every single operation. Contraction to fused multiply-adds (e.g. gfortran with -march=native) leaves the results correct but reduces the precision of the product to about 77 bits; -ffp-contract=off restores the full precision.
History
11.2026 moved out of gw_nevanlinna

Function/Subroutine Documentation

◆ dd_add()

elemental type(dd_type) function, public double_double::dd_add ( type(dd_type), intent(in) a,
type(dd_type), intent(in) b )

Sum of two double-double numbers.

Parameters
asummand
bsummand
Returns
a + b

Definition at line 121 of file double_double.F.

Here is the caller graph for this function:

◆ dd_sub()

elemental type(dd_type) function, public double_double::dd_sub ( type(dd_type), intent(in) a,
type(dd_type), intent(in) b )

Difference of two double-double numbers.

Parameters
aminuend
bsubtrahend
Returns
a - b

Definition at line 142 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dd_mul()

elemental type(dd_type) function, public double_double::dd_mul ( type(dd_type), intent(in) a,
type(dd_type), intent(in) b )

Product of two double-double numbers.

Parameters
afactor
bfactor
Returns
a*b

Definition at line 156 of file double_double.F.

Here is the caller graph for this function:

◆ dd_div()

elemental type(dd_type) function, public double_double::dd_div ( type(dd_type), intent(in) a,
type(dd_type), intent(in) b )

Quotient of two double-double numbers, by three steps of long division.

Parameters
adividend
bdivisor
Returns
a/b

Definition at line 174 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zdd()

elemental type(zdd_type) function, public double_double::zdd ( complex(kind=dp), intent(in) z)

Complex double-double number from a double-precision one.

Parameters
zcomplex number
Returns
z

Definition at line 196 of file double_double.F.

Here is the caller graph for this function:

◆ zdd_to_dp()

elemental complex(kind=dp) function, public double_double::zdd_to_dp ( type(zdd_type), intent(in) a)

Rounds a complex double-double number to double precision.

Parameters
acomplex double-double number
Returns
a in double precision

Definition at line 210 of file double_double.F.

Here is the caller graph for this function:

◆ zdd_add()

elemental type(zdd_type) function, public double_double::zdd_add ( type(zdd_type), intent(in) a,
type(zdd_type), intent(in) b )

Sum of two complex double-double numbers.

Parameters
asummand
bsummand
Returns
a + b

Definition at line 224 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zdd_sub()

elemental type(zdd_type) function, public double_double::zdd_sub ( type(zdd_type), intent(in) a,
type(zdd_type), intent(in) b )

Difference of two complex double-double numbers.

Parameters
aminuend
bsubtrahend
Returns
a - b

Definition at line 239 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zdd_mul()

elemental type(zdd_type) function, public double_double::zdd_mul ( type(zdd_type), intent(in) a,
type(zdd_type), intent(in) b )

Product of two complex double-double numbers.

Parameters
afactor
bfactor
Returns
a*b

Definition at line 254 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zdd_div()

elemental type(zdd_type) function, public double_double::zdd_div ( type(zdd_type), intent(in) a,
type(zdd_type), intent(in) b )

Quotient of two complex double-double numbers.

Parameters
adividend
bdivisor
Returns
a/b

Definition at line 269 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zdd_conjg()

elemental type(zdd_type) function, public double_double::zdd_conjg ( type(zdd_type), intent(in) a)

Complex conjugate of a complex double-double number.

Parameters
acomplex double-double number
Returns
conjugate of a

Definition at line 286 of file double_double.F.

Here is the caller graph for this function:

◆ zdd_abs2()

elemental real(kind=dp) function, public double_double::zdd_abs2 ( type(zdd_type), intent(in) a)

Squared modulus of a complex double-double number, rounded to double precision.

Parameters
acomplex double-double number
Returns
|a|**2

Definition at line 300 of file double_double.F.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ zdd_zero

type(zdd_type), parameter, public double_double::zdd_zero = zdd_type(dd_type(0.0_dp, 0.0_dp), dd_type(0.0_dp, 0.0_dp))

Definition at line 52 of file double_double.F.

◆ zdd_one

type(zdd_type), parameter, public double_double::zdd_one = zdd_type(dd_type(1.0_dp, 0.0_dp), dd_type(0.0_dp, 0.0_dp))

Definition at line 52 of file double_double.F.

◆ zdd_i

type(zdd_type), parameter, public double_double::zdd_i = zdd_type(dd_type(0.0_dp, 0.0_dp), dd_type(1.0_dp, 0.0_dp))

Definition at line 52 of file double_double.F.