1
C/MEMBR ADD NAME=PYTHAG,SSI=0
3
double precision function pythag(a,b)
5
c pythag calcule (a**2+b**2)**(1/2), par une methode iterative
7
c double precision function pythag(a,b)
10
double precision a,b,dlamch
11
double precision p,q,r,s,t
12
c --------testing Nans
13
if (isanan(a).eq.1) then
17
if (isanan(b).eq.1) then
22
if ( a.ge.dlamch('o').or.-a.ge.dlamch('o')) then
26
if ( b.ge.dlamch('o').or.-b.ge.dlamch('o')) then
30
c --------generic case
31
p = max(abs(a),abs(b))
32
q = min(abs(a),abs(b))
33
if (q .eq. 0.0d+0) go to 20
36
if (t .eq. 4.0d+0) go to 20