github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/mathext/internal/amos/amoslib/zdiv.f (about) 1 SUBROUTINE ZDIV(AR, AI, BR, BI, CR, CI) 2 C***BEGIN PROLOGUE ZDIV 3 C***REFER TO ZBESH,ZBESI,ZBESJ,ZBESK,ZBESY,ZAIRY,ZBIRY 4 C 5 C DOUBLE PRECISION COMPLEX DIVIDE C=A/B. 6 C 7 C***ROUTINES CALLED ZABS 8 C***END PROLOGUE ZDIV 9 DOUBLE PRECISION AR, AI, BR, BI, CR, CI, BM, CA, CB, CC, CD 10 DOUBLE PRECISION ZABS 11 BM = 1.0D0/ZABS(CMPLX(BR,BI,kind=KIND(1.0D0))) 12 CC = BR*BM 13 CD = BI*BM 14 CA = (AR*CC+AI*CD)*BM 15 CB = (AI*CC-AR*CD)*BM 16 CR = CA 17 CI = CB 18 RETURN 19 END