LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ slamch()

real function slamch ( character  CMACH)

SLAMCH

Purpose:
 SLAMCH determines single precision machine parameters.
Parameters
[in]CMACH
          CMACH is CHARACTER*1
          Specifies the value to be returned by SLAMCH:
          = 'E' or 'e',   SLAMCH := eps
          = 'S' or 's ,   SLAMCH := sfmin
          = 'B' or 'b',   SLAMCH := base
          = 'P' or 'p',   SLAMCH := eps*base
          = 'N' or 'n',   SLAMCH := t
          = 'R' or 'r',   SLAMCH := rnd
          = 'M' or 'm',   SLAMCH := emin
          = 'U' or 'u',   SLAMCH := rmin
          = 'L' or 'l',   SLAMCH := emax
          = 'O' or 'o',   SLAMCH := 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)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 70 of file slamch.f.

70 *
71 * -- LAPACK auxiliary routine (version 3.7.0) --
72 * -- LAPACK is a software package provided by Univ. of Tennessee, --
73 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
74 * December 2016
75 *
76 * .. Scalar Arguments ..
77  CHARACTER CMACH
78 * ..
79 *
80 * =====================================================================
81 *
82 * .. Parameters ..
83  REAL ONE, ZERO
84  parameter( one = 1.0e+0, zero = 0.0e+0 )
85 * ..
86 * .. Local Scalars ..
87  REAL RND, EPS, SFMIN, SMALL, RMACH
88 * ..
89 * .. External Functions ..
90  LOGICAL LSAME
91  EXTERNAL lsame
92 * ..
93 * .. Intrinsic Functions ..
94  INTRINSIC digits, epsilon, huge, maxexponent,
95  $ minexponent, radix, tiny
96 * ..
97 * .. Executable Statements ..
98 *
99 *
100 * Assume rounding, not chopping. Always.
101 *
102  rnd = one
103 *
104  IF( one.EQ.rnd ) THEN
105  eps = epsilon(zero) * 0.5
106  ELSE
107  eps = epsilon(zero)
108  END IF
109 *
110  IF( lsame( cmach, 'E' ) ) THEN
111  rmach = eps
112  ELSE IF( lsame( cmach, 'S' ) ) THEN
113  sfmin = tiny(zero)
114  small = one / huge(zero)
115  IF( small.GE.sfmin ) THEN
116 *
117 * Use SMALL plus a bit, to avoid the possibility of rounding
118 * causing overflow when computing 1/sfmin.
119 *
120  sfmin = small*( one+eps )
121  END IF
122  rmach = sfmin
123  ELSE IF( lsame( cmach, 'B' ) ) THEN
124  rmach = radix(zero)
125  ELSE IF( lsame( cmach, 'P' ) ) THEN
126  rmach = eps * radix(zero)
127  ELSE IF( lsame( cmach, 'N' ) ) THEN
128  rmach = digits(zero)
129  ELSE IF( lsame( cmach, 'R' ) ) THEN
130  rmach = rnd
131  ELSE IF( lsame( cmach, 'M' ) ) THEN
132  rmach = minexponent(zero)
133  ELSE IF( lsame( cmach, 'U' ) ) THEN
134  rmach = tiny(zero)
135  ELSE IF( lsame( cmach, 'L' ) ) THEN
136  rmach = maxexponent(zero)
137  ELSE IF( lsame( cmach, 'O' ) ) THEN
138  rmach = huge(zero)
139  ELSE
140  rmach = zero
141  END IF
142 *
143  slamch = rmach
144  RETURN
145 *
146 * End of SLAMCH
147 *
Here is the call graph for this function:
lsame
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
slamch
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:70