Fix for #4416 limit of Newton quotient involving asin
[maxima.git] / share / lapack / blas / fortran / zrotg.f
blobf6a4aa127deccbb06b04f95f1672e2b0c1f9259d
1 subroutine zrotg(ca,cb,c,s)
2 double complex ca,cb,s
3 double precision c
4 double precision norm,scale
5 double complex alpha
6 if (cdabs(ca) .ne. 0.0d0) go to 10
7 c = 0.0d0
8 s = (1.0d0,0.0d0)
9 ca = cb
10 go to 20
11 10 continue
12 scale = cdabs(ca) + cdabs(cb)
13 norm = scale*dsqrt((cdabs(ca/dcmplx(scale,0.0d0)))**2 +
14 * (cdabs(cb/dcmplx(scale,0.0d0)))**2)
15 alpha = ca /cdabs(ca)
16 c = cdabs(ca) / norm
17 s = alpha * dconjg(cb) / norm
18 ca = alpha * norm
19 20 continue
20 return
21 end