123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- DOUBLE PRECISION FUNCTION DLAMCH( CMACH )
- *
- * -- LAPACK auxiliary routine (version 3.3.0) --
- * -- LAPACK is a software package provided by Univ. of Tennessee, --
- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
- * Based on LAPACK DLAMCH but with Fortran 95 query functions
- * See: http://www.cs.utk.edu/~luszczek/lapack/lamch.html
- * and http://www.netlib.org/lapack-dev/lapack-coding/program-style.html#id2537289
- * July 2010
- *
- * .. Scalar Arguments ..
- CHARACTER CMACH
- * ..
- *
- * Purpose
- * =======
- *
- * DLAMCH determines double precision machine parameters.
- *
- * Arguments
- * =========
- *
- * CMACH (input) 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)
- *
- * =====================================================================
- *
- * .. Parameters ..
- DOUBLE PRECISION ONE, ZERO
- PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
- * ..
- * .. Local Scalars ..
- DOUBLE PRECISION RND, EPS, SFMIN, SMALL, RMACH
- * ..
- * .. External Functions ..
- LOGICAL LSAME
- EXTERNAL LSAME
- * ..
- * .. Intrinsic Functions ..
- INTRINSIC DIGITS, EPSILON, HUGE, MAXEXPONENT,
- $ MINEXPONENT, RADIX, TINY
- * ..
- * .. Executable Statements ..
- *
- *
- * Assume rounding, not chopping. Always.
- *
- RND = ONE
- *
- IF( ONE.EQ.RND ) THEN
- EPS = EPSILON(ZERO) * 0.5
- ELSE
- EPS = EPSILON(ZERO)
- END IF
- *
- IF( LSAME( CMACH, 'E' ) ) THEN
- RMACH = EPS
- ELSE IF( LSAME( CMACH, 'S' ) ) THEN
- SFMIN = TINY(ZERO)
- SMALL = ONE / HUGE(ZERO)
- IF( SMALL.GE.SFMIN ) THEN
- *
- * Use SMALL plus a bit, to avoid the possibility of rounding
- * causing overflow when computing 1/sfmin.
- *
- SFMIN = SMALL*( ONE+EPS )
- END IF
- RMACH = SFMIN
- ELSE IF( LSAME( CMACH, 'B' ) ) THEN
- RMACH = RADIX(ZERO)
- ELSE IF( LSAME( CMACH, 'P' ) ) THEN
- RMACH = EPS * RADIX(ZERO)
- ELSE IF( LSAME( CMACH, 'N' ) ) THEN
- RMACH = DIGITS(ZERO)
- ELSE IF( LSAME( CMACH, 'R' ) ) THEN
- RMACH = RND
- ELSE IF( LSAME( CMACH, 'M' ) ) THEN
- RMACH = MINEXPONENT(ZERO)
- ELSE IF( LSAME( CMACH, 'U' ) ) THEN
- RMACH = tiny(zero)
- ELSE IF( LSAME( CMACH, 'L' ) ) THEN
- RMACH = MAXEXPONENT(ZERO)
- ELSE IF( LSAME( CMACH, 'O' ) ) THEN
- RMACH = HUGE(ZERO)
- ELSE
- RMACH = ZERO
- END IF
- *
- DLAMCH = RMACH
- RETURN
- *
- * End of DLAMCH
- *
- END
- ************************************************************************
- *
- DOUBLE PRECISION FUNCTION DLAMC3( A, B )
- *
- * -- LAPACK auxiliary routine (version 3.3.0) --
- * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
- * November 2010
- *
- * .. Scalar Arguments ..
- DOUBLE PRECISION A, B
- * ..
- *
- * 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.
- *
- * Arguments
- * =========
- *
- * A (input) DOUBLE PRECISION
- * B (input) DOUBLE PRECISION
- * The values A and B.
- *
- * =====================================================================
- *
- * .. Executable Statements ..
- *
- DLAMC3 = A + B
- *
- RETURN
- *
- * End of DLAMC3
- *
- END
- *
- ************************************************************************
|