home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
eispack-1.0-src.tgz
/
tar.out
/
contrib
/
eispack
/
cdiv.f
< prev
next >
Wrap
Text File
|
1996-09-28
|
390b
|
17 lines
subroutine cdiv(ar,ai,br,bi,cr,ci)
double precision ar,ai,br,bi,cr,ci
c
c complex division, (cr,ci) = (ar,ai)/(br,bi)
c
double precision s,ars,ais,brs,bis
s = dabs(br) + dabs(bi)
ars = ar/s
ais = ai/s
brs = br/s
bis = bi/s
s = brs**2 + bis**2
cr = (ars*brs + ais*bis)/s
ci = (ais*brs - ars*bis)/s
return
end