@@ -122,7 +122,7 @@ subroutine CROTG( a, b, c, s )
122122 complex (wp) :: a, b, s
123123! ..
124124! .. Local Scalars ..
125- real (wp) :: d, f1, f2, g1, g2, h2, p, u, uu, v, vv , w
125+ real (wp) :: d, f1, f2, g1, g2, h2, u, v , w
126126 complex (wp) :: f, fs, g, gs, r, t
127127! ..
128128! .. Intrinsic Functions ..
@@ -149,19 +149,16 @@ subroutine CROTG( a, b, c, s )
149149!
150150! Use unscaled algorithm
151151!
152- g2 = ABSSQ( g )
153- d = sqrt ( g2 )
152+ d = abs ( g )
154153 s = conjg ( g ) / d
155154 r = d
156155 else
157156!
158157! Use scaled algorithm
159158!
160159 u = min ( safmax, max ( safmin, g1 ) )
161- uu = one / u
162- gs = g* uu
163- g2 = ABSSQ( gs )
164- d = sqrt ( g2 )
160+ gs = g / u
161+ d = abs ( gs )
165162 s = conjg ( gs ) / d
166163 r = d* u
167164 end if
@@ -181,35 +178,32 @@ subroutine CROTG( a, b, c, s )
181178 else
182179 d = sqrt ( f2 )* sqrt ( h2 )
183180 end if
184- p = 1 / d
185- c = f2* p
186- s = conjg ( g )* ( f* p )
187- r = f* ( h2* p )
181+ c = f2 / d
182+ s = conjg ( g )* ( f / d )
183+ r = f* ( h2 / d )
188184 else
189185!
190186! Use scaled algorithm
191187!
192188 u = min ( safmax, max ( safmin, f1, g1 ) )
193- uu = one / u
194- gs = g* uu
189+ gs = g / u
195190 g2 = ABSSQ( gs )
196- if ( f1* uu < rtmin ) then
191+ if ( f1 / u < rtmin ) then
197192!
198193! f is not well-scaled when scaled by g1.
199194! Use a different scaling for f.
200195!
201196 v = min ( safmax, max ( safmin, f1 ) )
202- vv = one / v
203- w = v * uu
204- fs = f* vv
197+ w = v / u
198+ fs = f / v
205199 f2 = ABSSQ( fs )
206200 h2 = f2* w** 2 + g2
207201 else
208202!
209203! Otherwise use the same scaling for f and g.
210204!
211205 w = one
212- fs = f* uu
206+ fs = f / u
213207 f2 = ABSSQ( fs )
214208 h2 = f2 + g2
215209 end if
@@ -218,10 +212,9 @@ subroutine CROTG( a, b, c, s )
218212 else
219213 d = sqrt ( f2 )* sqrt ( h2 )
220214 end if
221- p = 1 / d
222- c = ( f2* p )* w
223- s = conjg ( gs )* ( fs* p )
224- r = ( fs* ( h2* p ) )* u
215+ c = ( f2 / d )* w
216+ s = conjg ( gs )* ( fs / d )
217+ r = ( fs* ( h2 / d ) )* u
225218 end if
226219 end if
227220 a = r
0 commit comments