 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ slamch()

 real function slamch ( character CMACH )

SLAMCH

Purpose:
` SLAMCH determines single precision machine parameters.`
Parameters
 [in] CMACH ``` 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)```
Date
December 2016

Definition at line 69 of file slamch.f.

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