92 SUBROUTINE sladiv( A, B, C, D, P, Q )
100 REAL A, B, C, D, P, Q
107 parameter ( bs = 2.0e0 )
109 parameter ( half = 0.5e0 )
111 parameter ( two = 2.0e0 )
114 REAL AA, BB, CC, DD, AB, CD, S, OV, UN, BE, EPS
132 ab = max( abs(a), abs(b) )
133 cd = max( abs(c), abs(d) )
136 ov = slamch(
'Overflow threshold' )
137 un = slamch(
'Safe minimum' )
138 eps = slamch(
'Epsilon' )
141 IF( ab >= half*ov )
THEN
146 IF( cd >= half*ov )
THEN
151 IF( ab <= un*bs/eps )
THEN
156 IF( cd <= un*bs/eps )
THEN
161 IF( abs( d ).LE.abs( c ) )
THEN
162 CALL sladiv1(aa, bb, cc, dd, p, q)
164 CALL sladiv1(bb, aa, dd, cc, p, q)
179 SUBROUTINE sladiv1( A, B, C, D, P, Q )
187 REAL A, B, C, D, P, Q
194 parameter ( one = 1.0e0 )
206 t = one / (c + d * r)
207 p = sladiv2(a, b, c, d, r, t)
209 q = sladiv2(b, a, c, d, r, t)
219 REAL FUNCTION sladiv2( A, B, C, D, R, T )
227 REAL A, B, C, D, R, T
234 parameter ( zero = 0.0e0 )
243 if( br.NE.zero )
THEN
249 sladiv2 = (a + d * (b / c)) * t
subroutine sladiv(A, B, C, D, P, Q)
SLADIV performs complex division in real arithmetic, avoiding unnecessary overflow.
subroutine sladiv1(A, B, C, D, P, Q)
real function sladiv2(A, B, C, D, R, T)