1 SUBROUTINE xzsqrt(AR, AI, BR, BI)
9 DOUBLE PRECISION AR, AI, BR, BI, ZM, DTHETA, DPI, DRT
10 DOUBLE PRECISION XZABS
11 DATA drt , dpi / 7.071067811865475244008443621d-1,
12 1 3.141592653589793238462643383d+0/
15 IF (ar.EQ.0.0d+0)
GO TO 10
16 IF (ai.EQ.0.0d+0)
GO TO 20
18 IF (dtheta.LE.0.0d+0)
GO TO 40
19 IF (ar.LT.0.0d+0) dtheta = dtheta - dpi
21 10
IF (ai.GT.0.0d+0)
GO TO 60
22 IF (ai.LT.0.0d+0)
GO TO 70
26 20
IF (ar.GT.0.0d+0)
GO TO 30
33 40
IF (ar.LT.0.0d+0) dtheta = dtheta + dpi
34 50 dtheta = dtheta*0.5d+0
subroutine xzsqrt(AR, AI, BR, BI)