LAPACK  3.8.0
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.
Date
April 2012

Definition at line 69 of file slamchf77.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 * April 2012
74 *
75 * .. Scalar Arguments ..
76  CHARACTER cmach
77 * ..
78 * .. Parameters ..
79  REAL one, zero
80  parameter( one = 1.0e+0, zero = 0.0e+0 )
81 * ..
82 * .. Local Scalars ..
83  LOGICAL first, lrnd
84  INTEGER beta, imax, imin, it
85  REAL base, emax, emin, eps, prec, rmach, rmax, rmin,
86  $ rnd, sfmin, small, t
87 * ..
88 * .. External Functions ..
89  LOGICAL lsame
90  EXTERNAL lsame
91 * ..
92 * .. External Subroutines ..
93  EXTERNAL slamc2
94 * ..
95 * .. Save statement ..
96  SAVE first, eps, sfmin, base, t, rnd, emin, rmin,
97  $ emax, rmax, prec
98 * ..
99 * .. Data statements ..
100  DATA first / .true. /
101 * ..
102 * .. Executable Statements ..
103 *
104  IF( first ) THEN
105  CALL slamc2( beta, it, lrnd, eps, imin, rmin, imax, rmax )
106  base = beta
107  t = it
108  IF( lrnd ) THEN
109  rnd = one
110  eps = ( base**( 1-it ) ) / 2
111  ELSE
112  rnd = zero
113  eps = base**( 1-it )
114  END IF
115  prec = eps*base
116  emin = imin
117  emax = imax
118  sfmin = rmin
119  small = one / rmax
120  IF( small.GE.sfmin ) THEN
121 *
122 * Use SMALL plus a bit, to avoid the possibility of rounding
123 * causing overflow when computing 1/sfmin.
124 *
125  sfmin = small*( one+eps )
126  END IF
127  END IF
128 *
129  IF( lsame( cmach, 'E' ) ) THEN
130  rmach = eps
131  ELSE IF( lsame( cmach, 'S' ) ) THEN
132  rmach = sfmin
133  ELSE IF( lsame( cmach, 'B' ) ) THEN
134  rmach = base
135  ELSE IF( lsame( cmach, 'P' ) ) THEN
136  rmach = prec
137  ELSE IF( lsame( cmach, 'N' ) ) THEN
138  rmach = t
139  ELSE IF( lsame( cmach, 'R' ) ) THEN
140  rmach = rnd
141  ELSE IF( lsame( cmach, 'M' ) ) THEN
142  rmach = emin
143  ELSE IF( lsame( cmach, 'U' ) ) THEN
144  rmach = rmin
145  ELSE IF( lsame( cmach, 'L' ) ) THEN
146  rmach = emax
147  ELSE IF( lsame( cmach, 'O' ) ) THEN
148  rmach = rmax
149  END IF
150 *
151  slamch = rmach
152  first = .false.
153  RETURN
154 *
155 * End of SLAMCH
156 *
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine slamc2(BETA, T, RND, EPS, EMIN, RMIN, EMAX, RMAX)
SLAMC2
Definition: slamchf77.f:424
Here is the call graph for this function: