LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ slamch()

real function slamch ( character  CMACH)

SLAMCHF77 deprecated

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)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 66 of file slamchf77.f.

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