OpenLibm/slatec/zuchk.f

41 lines
1.3 KiB
FortranFixed
Raw Normal View History

*DECK ZUCHK
SUBROUTINE ZUCHK (YR, YI, NZ, ASCLE, TOL)
2012-10-29 10:44:32 +01:00
C***BEGIN PROLOGUE ZUCHK
C***SUBSIDIARY
C***PURPOSE Subsidiary to SERI, ZUOIK, ZUNK1, ZUNK2, ZUNI1, ZUNI2 and
C ZKSCL
C***LIBRARY SLATEC
C***TYPE ALL (CUCHK-A, ZUCHK-A)
C***AUTHOR Amos, D. E., (SNL)
C***DESCRIPTION
2012-10-29 10:44:32 +01:00
C
C Y ENTERS AS A SCALED QUANTITY WHOSE MAGNITUDE IS GREATER THAN
C EXP(-ALIM)=ASCLE=1.0E+3*D1MACH(1)/TOL. THE TEST IS MADE TO SEE
C IF THE MAGNITUDE OF THE REAL OR IMAGINARY PART WOULD UNDERFLOW
C WHEN Y IS SCALED (BY TOL) TO ITS PROPER VALUE. Y IS ACCEPTED
C IF THE UNDERFLOW IS AT LEAST ONE PRECISION BELOW THE MAGNITUDE
C OF THE LARGEST COMPONENT; OTHERWISE THE PHASE ANGLE DOES NOT HAVE
C ABSOLUTE ACCURACY AND AN UNDERFLOW IS ASSUMED.
C
C***SEE ALSO SERI, ZKSCL, ZUNI1, ZUNI2, ZUNK1, ZUNK2, ZUOIK
2012-10-29 10:44:32 +01:00
C***ROUTINES CALLED (NONE)
C***REVISION HISTORY (YYMMDD)
C ?????? DATE WRITTEN
C 910415 Prologue converted to Version 4.0 format. (BAB)
2012-10-29 10:44:32 +01:00
C***END PROLOGUE ZUCHK
C
C COMPLEX Y
DOUBLE PRECISION ASCLE, SS, ST, TOL, WR, WI, YR, YI
INTEGER NZ
C***FIRST EXECUTABLE STATEMENT ZUCHK
2012-10-29 10:44:32 +01:00
NZ = 0
WR = ABS(YR)
WI = ABS(YI)
ST = MIN(WR,WI)
2012-10-29 10:44:32 +01:00
IF (ST.GT.ASCLE) RETURN
SS = MAX(WR,WI)
2012-10-29 10:44:32 +01:00
ST = ST/TOL
IF (SS.LT.ST) NZ = 1
RETURN
END