LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
la_constants.f90
Go to the documentation of this file.
1
2!
3! =========== DOCUMENTATION ===========
4!
5! Online html documentation available at
6! http://www.netlib.org/lapack/explore-html/
7!
8! Authors:
9! ========
10!
12!
14!
16!
18! ==================
22!
24! =====================
39!
41! -- LAPACK auxiliary module --
42! -- LAPACK is a software package provided by Univ. of Tennessee, --
43! -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
44
45! Standard constants for
46 integer, parameter :: sp = kind(1.e0)
47
48 real(sp), parameter :: szero = 0.0_sp
49 real(sp), parameter :: shalf = 0.5_sp
50 real(sp), parameter :: sone = 1.0_sp
51 real(sp), parameter :: stwo = 2.0_sp
52 real(sp), parameter :: sthree = 3.0_sp
53 real(sp), parameter :: sfour = 4.0_sp
54 real(sp), parameter :: seight = 8.0_sp
55 real(sp), parameter :: sten = 10.0_sp
56 complex(sp), parameter :: czero = ( 0.0_sp, 0.0_sp )
57 complex(sp), parameter :: chalf = ( 0.5_sp, 0.0_sp )
58 complex(sp), parameter :: cone = ( 1.0_sp, 0.0_sp )
59 character*1, parameter :: sprefix = 'S'
60 character*1, parameter :: cprefix = 'C'
61
62! Scaling constants
63 real(sp), parameter :: sulp = epsilon(0._sp)
64 real(sp), parameter :: seps = sulp * 0.5_sp
65 real(sp), parameter :: ssafmin = real(radix(0._sp),sp)**max( &
66 minexponent(0._sp)-1, &
67 1-maxexponent(0._sp) &
68 )
69 real(sp), parameter :: ssafmax = sone / ssafmin
70 real(sp), parameter :: ssmlnum = ssafmin / sulp
71 real(sp), parameter :: sbignum = ssafmax * sulp
72 real(sp), parameter :: srtmin = sqrt(ssmlnum)
73 real(sp), parameter :: srtmax = sqrt(sbignum)
74
75! Blue's scaling constants
76 real(sp), parameter :: stsml = real(radix(0._sp), sp)**ceiling( &
77 (minexponent(0._sp) - 1) * 0.5_sp)
78 real(sp), parameter :: stbig = real(radix(0._sp), sp)**floor( &
79 (maxexponent(0._sp) - digits(0._sp) + 1) * 0.5_sp)
80! ssml >= 1/s, where s was defined in https://doi.org/10.1145/355769.355771
81! The correction was added in https://doi.org/10.1145/3061665 to scale denormalized numbers correctly
82 real(sp), parameter :: sssml = real(radix(0._sp), sp)**( - floor( &
83 (minexponent(0._sp) - digits(0._sp)) * 0.5_sp))
84! sbig = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
85 real(sp), parameter :: ssbig = real(radix(0._sp), sp)**( - ceiling( &
86 (maxexponent(0._sp) + digits(0._sp) - 1) * 0.5_sp))
87
88! Standard constants for
89 integer, parameter :: dp = kind(1.d0)
90
91 real(dp), parameter :: dzero = 0.0_dp
92 real(dp), parameter :: dhalf = 0.5_dp
93 real(dp), parameter :: done = 1.0_dp
94 real(dp), parameter :: dtwo = 2.0_dp
95 real(dp), parameter :: dthree = 3.0_dp
96 real(dp), parameter :: dfour = 4.0_dp
97 real(dp), parameter :: deight = 8.0_dp
98 real(dp), parameter :: dten = 10.0_dp
99 complex(dp), parameter :: zzero = ( 0.0_dp, 0.0_dp )
100 complex(dp), parameter :: zhalf = ( 0.5_dp, 0.0_dp )
101 complex(dp), parameter :: zone = ( 1.0_dp, 0.0_dp )
102 character*1, parameter :: dprefix = 'D'
103 character*1, parameter :: zprefix = 'Z'
104
105! Scaling constants
106 real(dp), parameter :: dulp = epsilon(0._dp)
107 real(dp), parameter :: deps = dulp * 0.5_dp
108 real(dp), parameter :: dsafmin = real(radix(0._dp),dp)**max( &
109 minexponent(0._dp)-1, &
110 1-maxexponent(0._dp) &
111 )
112 real(dp), parameter :: dsafmax = done / dsafmin
113 real(dp), parameter :: dsmlnum = dsafmin / dulp
114 real(dp), parameter :: dbignum = dsafmax * dulp
115 real(dp), parameter :: drtmin = sqrt(dsmlnum)
116 real(dp), parameter :: drtmax = sqrt(dbignum)
117
118! Blue's scaling constants
119 real(dp), parameter :: dtsml = real(radix(0._dp), dp)**ceiling( &
120 (minexponent(0._dp) - 1) * 0.5_dp)
121 real(dp), parameter :: dtbig = real(radix(0._dp), dp)**floor( &
122 (maxexponent(0._dp) - digits(0._dp) + 1) * 0.5_dp)
123! ssml >= 1/s, where s was defined in https://doi.org/10.1145/355769.355771
124! The correction was added in https://doi.org/10.1145/3061665 to scale denormalized numbers correctly
125 real(dp), parameter :: dssml = real(radix(0._dp), dp)**( - floor( &
126 (minexponent(0._dp) - digits(0._dp)) * 0.5_dp))
127! sbig = 1/S, where S was defined in https://doi.org/10.1145/355769.355771
128 real(dp), parameter :: dsbig = real(radix(0._dp), dp)**( - ceiling( &
129 (maxexponent(0._dp) + digits(0._dp) - 1) * 0.5_dp))
130
131end module la_constants
real(sp), parameter srtmax
complex(sp), parameter cone
real(dp), parameter dtsml
real(sp), parameter stbig
real(sp), parameter sssml
real(sp), parameter sone
real(dp), parameter dhalf
real(sp), parameter seps
real(sp), parameter sulp
real(dp), parameter dten
real(sp), parameter ssmlnum
real(dp), parameter dtwo
real(sp), parameter stsml
real(dp), parameter deps
real(sp), parameter shalf
character *1, parameter zprefix
real(dp), parameter dzero
real(sp), parameter sbignum
real(sp), parameter sthree
complex(dp), parameter zhalf
real(sp), parameter stwo
real(dp), parameter dsbig
real(dp), parameter dulp
real(dp), parameter dbignum
real(dp), parameter drtmax
real(dp), parameter dsafmin
integer, parameter dp
real(dp), parameter drtmin
real(sp), parameter srtmin
real(dp), parameter dthree
complex(dp), parameter zone
real(dp), parameter deight
real(dp), parameter done
complex(sp), parameter czero
real(sp), parameter ssbig
character *1, parameter dprefix
integer, parameter sp
character *1, parameter sprefix
real(sp), parameter ssafmin
real(sp), parameter ssafmax
complex(dp), parameter zzero
real(sp), parameter szero
real(dp), parameter dsafmax
real(dp), parameter dtbig
real(dp), parameter dfour
real(sp), parameter sten
character *1, parameter cprefix
complex(sp), parameter chalf
real(sp), parameter seight
real(dp), parameter dsmlnum
real(dp), parameter dssml
real(sp), parameter sfour
LA_CONSTANTS is a module for the scaling constants for the compiled Fortran single and double precisi...