OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
dlamch.f File Reference

Go to the source code of this file.

Functions/Subroutines

double precision function dlamch (cmach)
 DLAMCH
double precision function dlamc3 (a, b)
 DLAMC3

Function/Subroutine Documentation

◆ dlamc3()

double precision function dlamc3 ( double precision a,
double precision b )

DLAMC3

Purpose:

!> DLAMC3  is intended to force  A  and  B  to be stored prior to doing
!> the addition of  A  and  B ,  for use in situations where optimizers
!> might hold one of these in a register.
!> 
Author
LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
Parameters
[in]A
!>          A is a DOUBLE PRECISION
!> 
[in]B
!>          B is a DOUBLE PRECISION
!>          The values A and B.
!> 

Definition at line 168 of file dlamch.f.

169*
170* -- LAPACK auxiliary routine --
171* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
172*
173* .. Scalar Arguments ..
174 DOUBLE PRECISION A, B
175* ..
176* =====================================================================
177*
178* .. Executable Statements ..
179*
180 dlamc3 = a + b
181*
182 RETURN
183*
184* End of DLAMC3
185*
double precision function dlamc3(a, b)
DLAMC3
Definition dlamch.f:169

◆ dlamch()

double precision function dlamch ( character cmach)

DLAMCH

Purpose:
!>
!> DLAMCH determines double precision machine parameters.
!> 
Parameters
[in]CMACH
!>          CMACH is CHARACTER*1
!>          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)
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 68 of file dlamch.f.

69*
70* -- LAPACK auxiliary routine --
71* -- LAPACK is a software package provided by Univ. of Tennessee, --
72* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
73*
74* .. Scalar Arguments ..
75 CHARACTER CMACH
76* ..
77*
78* =====================================================================
79*
80* .. Parameters ..
81 DOUBLE PRECISION ONE, ZERO
82 parameter( one = 1.0d+0, zero = 0.0d+0 )
83* ..
84* .. Local Scalars ..
85 DOUBLE PRECISION RND, EPS, SFMIN, SMALL, RMACH
86* ..
87* .. External Functions ..
88 LOGICAL LSAME
89 EXTERNAL lsame
90* ..
91* .. Intrinsic Functions ..
92 INTRINSIC digits, epsilon, huge, maxexponent,
93 $ minexponent, radix, tiny
94* ..
95* .. Executable Statements ..
96*
97*
98* Assume rounding, not chopping. Always.
99*
100 rnd = one
101*
102 IF( one.EQ.rnd ) THEN
103 eps = epsilon(zero) * 0.5
104 ELSE
105 eps = epsilon(zero)
106 END IF
107*
108 IF( lsame( cmach, 'E' ) ) THEN
109 rmach = eps
110 ELSE IF( lsame( cmach, 'S' ) ) THEN
111 sfmin = tiny(zero)
112 small = one / huge(zero)
113 IF( small.GE.sfmin ) THEN
114*
115* Use SMALL plus a bit, to avoid the possibility of rounding
116* causing overflow when computing 1/sfmin.
117*
118 sfmin = small*( one+eps )
119 END IF
120 rmach = sfmin
121 ELSE IF( lsame( cmach, 'b' ) ) THEN
122 RMACH = RADIX(ZERO)
123 ELSE IF( LSAME( CMACH, 'p' ) ) THEN
124 RMACH = EPS * RADIX(ZERO)
125 ELSE IF( LSAME( CMACH, 'n' ) ) THEN
126 RMACH = DIGITS(ZERO)
127 ELSE IF( LSAME( CMACH, 'r' ) ) THEN
128 RMACH = RND
129 ELSE IF( LSAME( CMACH, 'm' ) ) THEN
130 RMACH = MINEXPONENT(ZERO)
131 ELSE IF( LSAME( CMACH, 'u' ) ) THEN
132 RMACH = tiny(zero)
133 ELSE IF( LSAME( CMACH, 'l' ) ) THEN
134 RMACH = MAXEXPONENT(ZERO)
135 ELSE IF( LSAME( CMACH, 'o' ) ) THEN
136 RMACH = HUGE(ZERO)
137 ELSE
138 RMACH = ZERO
139 END IF
140*
141 DLAMCH = RMACH
142 RETURN
143*
144* End of DLAMCH
145*
logical function lsame(ca, cb)
LSAME
Definition lsame.f:53