/
/   C L O G
/   - - - -
/
/ VERSION 5A 4-27-77  PT
/
/COMPLEX LOG ROUTINE
/
/ENTER + EXIT IN COMPLEX
/
/Z=X+IY
/LOG(Z)=LOG(ABS(Z))+I*THETA
/ABS(Z)=SQRT(X*X+Y*Y)
/THETA=ATAN(Y/X)
/
/CALLS REAL SQRT,LOG,ATAN2
/
	SECT	CLOG
	JA	#CLOG
	DPCHK
	TEXT	+CLOG  +
CLOGXR,	SETX	XR
	SETB	BP
	JA	.+3
BP,	F 0.0
XR,	F 0.0
	F 0.0
ARG,	F 0.0
	F 0.0
	ORG	10*3+BP
	FNOP
	JA	CLOGXR
	0
RT,	JA	.
	BASE	0
#CLOG,	STARTD
	FLDA	10*3
	FSTA	RT
	FLDA	0
	SETB	BP
	SETX	XR
	BASE	BP
	LDX	1,1
	FSTA	BP
	FLDA%	BP,1
	FSTA	BP
	STARTE
	FLDA%	BP
	FSTA	ARG
	STARTF
	EXTERN	ATAN2
	JSR	ATAN2
	JA	CL1
	JA	ARG+3		/ATAN(Y/X)
	JA	ARG
CL1,	FSTA	ETEMP
	FLDA	ARG
	FMULM	ARG
	FLDA	ARG+3
	FMUL	ARG+3		/X*X+Y*Y
	FADD	ARG
	FSTA	ARG
	EXTERN	SQRT
	JSR	SQRT		/TAKE SQRT
	JA	CL2
	JA	ARG
CL2,	FSTA	ARG
	EXTERN	ALOG		/ALOG(ABS(Z))
	JSR	ALOG
	JA	CL3
	JA	ARG
CL3,	FSTA	ARG		/REAL PART
	FLDA	ETEMP		/IMAGINARY PART
	FSTA	ARG+3
	STARTE
	FLDA	ARG
	FSTA	#CAC
	JA	RT
	EXTERN	#CAC
ETEMP,	F 0.0
