SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ slamch()

real function slamch ( character  cmach)

Definition at line 866 of file tools.f.

867*
868* -- LAPACK auxiliary routine (version 2.0) --
869* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
870* Courant Institute, Argonne National Lab, and Rice University
871* October 31, 1992
872*
873* .. Scalar Arguments ..
874 CHARACTER CMACH
875* ..
876*
877* Purpose
878* =======
879*
880* SLAMCH determines single precision machine parameters.
881*
882* Arguments
883* =========
884*
885* CMACH (input) CHARACTER*1
886* Specifies the value to be returned by SLAMCH:
887* = 'E' or 'e', SLAMCH := eps
888* = 'S' or 's , SLAMCH := sfmin
889* = 'B' or 'b', SLAMCH := base
890* = 'P' or 'p', SLAMCH := eps*base
891* = 'N' or 'n', SLAMCH := t
892* = 'R' or 'r', SLAMCH := rnd
893* = 'M' or 'm', SLAMCH := emin
894* = 'U' or 'u', SLAMCH := rmin
895* = 'L' or 'l', SLAMCH := emax
896* = 'O' or 'o', SLAMCH := rmax
897*
898* where
899*
900* eps = relative machine precision
901* sfmin = safe minimum, such that 1/sfmin does not overflow
902* base = base of the machine
903* prec = eps*base
904* t = number of (base) digits in the mantissa
905* rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
906* emin = minimum exponent before (gradual) underflow
907* rmin = underflow threshold - base**(emin-1)
908* emax = largest exponent before overflow
909* rmax = overflow threshold - (base**emax)*(1-eps)
910*
911* =====================================================================
912*
913* .. Parameters ..
914 REAL ONE, ZERO
915 parameter( one = 1.0e+0, zero = 0.0e+0 )
916* ..
917* .. Local Scalars ..
918 LOGICAL FIRST, LRND
919 INTEGER BETA, IMAX, IMIN, IT
920 REAL BASE, EMAX, EMIN, EPS, PREC, RMACH, RMAX, RMIN,
921 $ RND, SFMIN, SMALL, T
922* ..
923* .. External Functions ..
924 LOGICAL LSAME
925 EXTERNAL lsame
926* ..
927* .. External Subroutines ..
928 EXTERNAL slamc2
929* ..
930* .. Save statement ..
931 SAVE first, eps, sfmin, base, t, rnd, emin, rmin,
932 $ emax, rmax, prec
933* ..
934* .. Data statements ..
935 DATA first / .true. /
936* ..
937* .. Executable Statements ..
938*
939 IF( first ) THEN
940 first = .false.
941 CALL slamc2( beta, it, lrnd, eps, imin, rmin, imax, rmax )
942 base = beta
943 t = it
944 IF( lrnd ) THEN
945 rnd = one
946 eps = ( base**( 1-it ) ) / 2
947 ELSE
948 rnd = zero
949 eps = base**( 1-it )
950 END IF
951 prec = eps*base
952 emin = imin
953 emax = imax
954 sfmin = rmin
955 small = one / rmax
956 IF( small.GE.sfmin ) THEN
957*
958* Use SMALL plus a bit, to avoid the possibility of rounding
959* causing overflow when computing 1/sfmin.
960*
961 sfmin = small*( one+eps )
962 END IF
963 END IF
964*
965 IF( lsame( cmach, 'E' ) ) THEN
966 rmach = eps
967 ELSE IF( lsame( cmach, 'S' ) ) THEN
968 rmach = sfmin
969 ELSE IF( lsame( cmach, 'B' ) ) THEN
970 rmach = base
971 ELSE IF( lsame( cmach, 'P' ) ) THEN
972 rmach = prec
973 ELSE IF( lsame( cmach, 'N' ) ) THEN
974 rmach = t
975 ELSE IF( lsame( cmach, 'R' ) ) THEN
976 rmach = rnd
977 ELSE IF( lsame( cmach, 'M' ) ) THEN
978 rmach = emin
979 ELSE IF( lsame( cmach, 'U' ) ) THEN
980 rmach = rmin
981 ELSE IF( lsame( cmach, 'L' ) ) THEN
982 rmach = emax
983 ELSE IF( lsame( cmach, 'O' ) ) THEN
984 rmach = rmax
985 END IF
986*
987 slamch = rmach
988 RETURN
989*
990* End of SLAMCH
991*
logical function lsame(ca, cb)
Definition tools.f:1724
real function slamch(cmach)
Definition tools.f:867
subroutine slamc2(beta, t, rnd, eps, emin, rmin, emax, rmax)
Definition tools.f:1184
Here is the call graph for this function:
Here is the caller graph for this function: