GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
zuchk.f
Go to the documentation of this file.
1  SUBROUTINE zuchk(YR, YI, NZ, ASCLE, TOL)
2 C***BEGIN PROLOGUE ZUCHK
3 C***REFER TO ZSERI,ZUOIK,ZUNK1,ZUNK2,ZUNI1,ZUNI2,ZKSCL
4 C
5 C Y ENTERS AS A SCALED QUANTITY WHOSE MAGNITUDE IS GREATER THAN
6 C EXP(-ALIM)=ASCLE=1.0E+3*D1MACH(1)/TOL. THE TEST IS MADE TO SEE
7 C IF THE MAGNITUDE OF THE REAL OR IMAGINARY PART WOULD UNDERFLOW
8 C WHEN Y IS SCALED (BY TOL) TO ITS PROPER VALUE. Y IS ACCEPTED
9 C IF THE UNDERFLOW IS AT LEAST ONE PRECISION BELOW THE MAGNITUDE
10 C OF THE LARGEST COMPONENT; OTHERWISE THE PHASE ANGLE DOES NOT HAVE
11 C ABSOLUTE ACCURACY AND AN UNDERFLOW IS ASSUMED.
12 C
13 C***ROUTINES CALLED (NONE)
14 C***END PROLOGUE ZUCHK
15 C
16 C COMPLEX Y
17  DOUBLE PRECISION ascle, ss, st, tol, wr, wi, yr, yi
18  INTEGER nz
19  nz = 0
20  wr = dabs(yr)
21  wi = dabs(yi)
22  st = dmin1(wr,wi)
23  IF (st.GT.ascle) RETURN
24  ss = dmax1(wr,wi)
25  st = st/tol
26  IF (ss.LT.st) nz = 1
27  RETURN
28  END