 LAPACK  3.10.1 LAPACK: Linear Algebra PACKage

## ◆ dlamch()

 double precision function dlamch ( character CMACH )

DLAMCHF77 deprecated

Purpose:
` DLAMCHF77 determines double precision machine parameters.`
Parameters
 [in] CMACH ``` Specifies the value to be returned by DLAMCH: = 'E' or 'e', DLAMCH := eps = 'S' or 's , DLAMCH := sfmin = 'B' or 'b', DLAMCH := base = 'P' or 'p', DLAMCH := eps*base = 'N' or 'n', DLAMCH := t = 'R' or 'r', DLAMCH := rnd = 'M' or 'm', DLAMCH := emin = 'U' or 'u', DLAMCH := rmin = 'L' or 'l', DLAMCH := emax = 'O' or 'o', DLAMCH := rmax where eps = relative machine precision sfmin = safe minimum, such that 1/sfmin does not overflow base = base of the machine prec = eps*base t = number of (base) digits in the mantissa rnd = 1.0 when rounding occurs in addition, 0.0 otherwise emin = minimum exponent before (gradual) underflow rmin = underflow threshold - base**(emin-1) emax = largest exponent before overflow rmax = overflow threshold - (base**emax)*(1-eps)```

Definition at line 67 of file dlamchf77.f.

68 *
69 * -- LAPACK auxiliary routine --
70 * -- LAPACK is a software package provided by Univ. of Tennessee, --
71 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
72 *
73 * .. Scalar Arguments ..
74  CHARACTER CMACH
75 * ..
76 * .. Parameters ..
77  DOUBLE PRECISION ONE, ZERO
78  parameter( one = 1.0d+0, zero = 0.0d+0 )
79 * ..
80 * .. Local Scalars ..
81  LOGICAL FIRST, LRND
82  INTEGER BETA, IMAX, IMIN, IT
83  DOUBLE PRECISION BASE, EMAX, EMIN, EPS, PREC, RMACH, RMAX, RMIN,
84  \$ RND, SFMIN, SMALL, T
85 * ..
86 * .. External Functions ..
87  LOGICAL LSAME
88  EXTERNAL lsame
89 * ..
90 * .. External Subroutines ..
91  EXTERNAL dlamc2
92 * ..
93 * .. Save statement ..
94  SAVE first, eps, sfmin, base, t, rnd, emin, rmin,
95  \$ emax, rmax, prec
96 * ..
97 * .. Data statements ..
98  DATA first / .true. /
99 * ..
100 * .. Executable Statements ..
101 *
102  IF( first ) THEN
103  CALL dlamc2( beta, it, lrnd, eps, imin, rmin, imax, rmax )
104  base = beta
105  t = it
106  IF( lrnd ) THEN
107  rnd = one
108  eps = ( base**( 1-it ) ) / 2
109  ELSE
110  rnd = zero
111  eps = base**( 1-it )
112  END IF
113  prec = eps*base
114  emin = imin
115  emax = imax
116  sfmin = rmin
117  small = one / rmax
118  IF( small.GE.sfmin ) THEN
119 *
120 * Use SMALL plus a bit, to avoid the possibility of rounding
121 * causing overflow when computing 1/sfmin.
122 *
123  sfmin = small*( one+eps )
124  END IF
125  END IF
126 *
127  IF( lsame( cmach, 'E' ) ) THEN
128  rmach = eps
129  ELSE IF( lsame( cmach, 'S' ) ) THEN
130  rmach = sfmin
131  ELSE IF( lsame( cmach, 'B' ) ) THEN
132  rmach = base
133  ELSE IF( lsame( cmach, 'P' ) ) THEN
134  rmach = prec
135  ELSE IF( lsame( cmach, 'N' ) ) THEN
136  rmach = t
137  ELSE IF( lsame( cmach, 'R' ) ) THEN
138  rmach = rnd
139  ELSE IF( lsame( cmach, 'M' ) ) THEN
140  rmach = emin
141  ELSE IF( lsame( cmach, 'U' ) ) THEN
142  rmach = rmin
143  ELSE IF( lsame( cmach, 'L' ) ) THEN
144  rmach = emax
145  ELSE IF( lsame( cmach, 'O' ) ) THEN
146  rmach = rmax
147  END IF
148 *
149  dlamch = rmach
150  first = .false.
151  RETURN
152 *
153 * End of DLAMCH
154 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
subroutine dlamc2(BETA, T, RND, EPS, EMIN, RMIN, EMAX, RMAX)
DLAMC2
Definition: dlamchf77.f:419
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
Here is the call graph for this function: