LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlamch.f
Go to the documentation of this file.
1*> \brief \b DLAMCH
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* DOUBLE PRECISION FUNCTION DLAMCH( CMACH )
12*
13* .. Scalar Arguments ..
14* CHARACTER CMACH
15* ..
16*
17*
18*> \par Purpose:
19* =============
20*>
21*> \verbatim
22*>
23*> DLAMCH determines double precision machine parameters.
24*> \endverbatim
25*
26* Arguments:
27* ==========
28*
29*> \param[in] CMACH
30*> \verbatim
31*> CMACH is CHARACTER*1
32*> Specifies the value to be returned by DLAMCH:
33*> = 'E' or 'e', DLAMCH := eps
34*> = 'S' or 's , DLAMCH := sfmin
35*> = 'B' or 'b', DLAMCH := base
36*> = 'P' or 'p', DLAMCH := eps*base
37*> = 'N' or 'n', DLAMCH := t
38*> = 'R' or 'r', DLAMCH := rnd
39*> = 'M' or 'm', DLAMCH := emin
40*> = 'U' or 'u', DLAMCH := rmin
41*> = 'L' or 'l', DLAMCH := emax
42*> = 'O' or 'o', DLAMCH := rmax
43*> where
44*> eps = relative machine precision
45*> sfmin = safe minimum, such that 1/sfmin does not overflow
46*> base = base of the machine
47*> prec = eps*base
48*> t = number of (base) digits in the mantissa
49*> rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
50*> emin = minimum exponent before (gradual) underflow
51*> rmin = underflow threshold - base**(emin-1)
52*> emax = largest exponent before overflow
53*> rmax = overflow threshold - (base**emax)*(1-eps)
54*> \endverbatim
55*
56* Authors:
57* ========
58*
59*> \author Univ. of Tennessee
60*> \author Univ. of California Berkeley
61*> \author Univ. of Colorado Denver
62*> \author NAG Ltd.
63*
64
65*> \ingroup lamch
66*
67* =====================================================================
68 DOUBLE PRECISION FUNCTION dlamch( CMACH )
69*
70* -- LAPACK auxiliary routine --
71* -- LAPACK is a software package provided by Univ. of Tennessee, --
72* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
73*
74* .. Scalar Arguments ..
75 CHARACTER cmach
76* ..
77*
78* =====================================================================
79*
80* .. Parameters ..
81 DOUBLE PRECISION one, zero
82 parameter( one = 1.0d+0, zero = 0.0d+0 )
83* ..
84* .. Local Scalars ..
85 DOUBLE PRECISION rnd, eps, sfmin, small, rmach
86* ..
87* .. External Functions ..
88 LOGICAL lsame
89 EXTERNAL lsame
90* ..
91* .. Intrinsic Functions ..
92 INTRINSIC digits, epsilon, huge, maxexponent,
93 $ minexponent, radix, tiny
94* ..
95* .. Executable Statements ..
96*
97*
98* Assume rounding, not chopping. Always.
99*
100 rnd = one
101*
102 IF( one.EQ.rnd ) THEN
103 eps = epsilon(zero) * 0.5
104 ELSE
105 eps = epsilon(zero)
106 END IF
107*
108 IF( lsame( cmach, 'E' ) ) THEN
109 rmach = eps
110 ELSE IF( lsame( cmach, 'S' ) ) THEN
111 sfmin = tiny(zero)
112 small = one / huge(zero)
113 IF( small.GE.sfmin ) THEN
114*
115* Use SMALL plus a bit, to avoid the possibility of rounding
116* causing overflow when computing 1/sfmin.
117*
118 sfmin = small*( one+eps )
119 END IF
120 rmach = sfmin
121 ELSE IF( lsame( cmach, 'B' ) ) THEN
122 rmach = radix(zero)
123 ELSE IF( lsame( cmach, 'P' ) ) THEN
124 rmach = eps * radix(zero)
125 ELSE IF( lsame( cmach, 'N' ) ) THEN
126 rmach = digits(zero)
127 ELSE IF( lsame( cmach, 'R' ) ) THEN
128 rmach = rnd
129 ELSE IF( lsame( cmach, 'M' ) ) THEN
130 rmach = minexponent(zero)
131 ELSE IF( lsame( cmach, 'U' ) ) THEN
132 rmach = tiny(zero)
133 ELSE IF( lsame( cmach, 'L' ) ) THEN
134 rmach = maxexponent(zero)
135 ELSE IF( lsame( cmach, 'O' ) ) THEN
136 rmach = huge(zero)
137 ELSE
138 rmach = zero
139 END IF
140*
141 dlamch = rmach
142 RETURN
143*
144* End of DLAMCH
145*
146 END
147
148************************************************************************
149*> \brief \b DLAMC3
150*> \details
151*> \b Purpose:
152*> \verbatim
153*> DLAMC3 is intended to force A and B to be stored prior to doing
154*> the addition of A and B , for use in situations where optimizers
155*> might hold one of these in a register.
156*> \endverbatim
157*> \author LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
158*> \param[in] A
159*> \verbatim
160*> A is a DOUBLE PRECISION
161*> \endverbatim
162*>
163*> \param[in] B
164*> \verbatim
165*> B is a DOUBLE PRECISION
166*> The values A and B.
167*> \endverbatim
168*>
169*> \ingroup lamc3
170*>
171 DOUBLE PRECISION FUNCTION dlamc3( A, B )
172*
173* -- LAPACK auxiliary routine --
174* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
175*
176* .. Scalar Arguments ..
177 DOUBLE PRECISION a, b
178* ..
179* =====================================================================
180*
181* .. Executable Statements ..
182*
183 dlamc3 = a + b
184*
185 RETURN
186*
187* End of DLAMC3
188*
189 END
190*
191************************************************************************
double precision function dlamc3(a, b)
DLAMC3
Definition dlamch.f:172
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48