Add some basic letsimp tests based on bug #3950
[maxima.git] / share / lapack / blas / fortran / drotg.f
blob67838e2cb3708b23d440b5da75501654db7a6df0
1 subroutine drotg(da,db,c,s)
3 c construct givens plane rotation.
4 c jack dongarra, linpack, 3/11/78.
6 double precision da,db,c,s,roe,scale,r,z
8 roe = db
9 if( dabs(da) .gt. dabs(db) ) roe = da
10 scale = dabs(da) + dabs(db)
11 if( scale .ne. 0.0d0 ) go to 10
12 c = 1.0d0
13 s = 0.0d0
14 r = 0.0d0
15 z = 0.0d0
16 go to 20
17 10 r = scale*dsqrt((da/scale)**2 + (db/scale)**2)
18 r = dsign(1.0d0,roe)*r
19 c = da/r
20 s = db/r
21 z = 1.0d0
22 if( dabs(da) .gt. dabs(db) ) z = s
23 if( dabs(db) .ge. dabs(da) .and. c .ne. 0.0d0 ) z = 1.0d0/c
24 20 da = r
25 db = z
26 return
27 end