xzlog.f

Go to the documentation of this file.
00001       SUBROUTINE XZLOG(AR, AI, BR, BI, IERR)
00002 C***BEGIN PROLOGUE  XZLOG
00003 C***REFER TO  ZBESH,ZBESI,ZBESJ,ZBESK,ZBESY,ZAIRY,ZBIRY
00004 C
00005 C     DOUBLE PRECISION COMPLEX LOGARITHM B=CLOG(A)
00006 C     IERR=0,NORMAL RETURN      IERR=1, Z=CMPLX(0.0,0.0)
00007 C***ROUTINES CALLED  XZABS
00008 C***END PROLOGUE  XZLOG
00009       DOUBLE PRECISION AR, AI, BR, BI, ZM, DTHETA, DPI, DHPI
00010       DOUBLE PRECISION XZABS
00011       DATA DPI , DHPI  / 3.141592653589793238462643383D+0,
00012      1                   1.570796326794896619231321696D+0/
00013 C
00014       IERR=0
00015       IF (AR.EQ.0.0D+0) GO TO 10
00016       IF (AI.EQ.0.0D+0) GO TO 20
00017       DTHETA = DATAN(AI/AR)
00018       IF (DTHETA.LE.0.0D+0) GO TO 40
00019       IF (AR.LT.0.0D+0) DTHETA = DTHETA - DPI
00020       GO TO 50
00021    10 IF (AI.EQ.0.0D+0) GO TO 60
00022       BI = DHPI
00023       BR = DLOG(DABS(AI))
00024       IF (AI.LT.0.0D+0) BI = -BI
00025       RETURN
00026    20 IF (AR.GT.0.0D+0) GO TO 30
00027       BR = DLOG(DABS(AR))
00028       BI = DPI
00029       RETURN
00030    30 BR = DLOG(AR)
00031       BI = 0.0D+0
00032       RETURN
00033    40 IF (AR.LT.0.0D+0) DTHETA = DTHETA + DPI
00034    50 ZM = XZABS(AR,AI)
00035       BR = DLOG(ZM)
00036       BI = DTHETA
00037       RETURN
00038    60 CONTINUE
00039       IERR=1
00040       RETURN
00041       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines