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)
178 SUBROUTINE sladiv1( A, B, C, D, P, Q )
186 REAL A, B, C, D, P, Q
193 parameter ( one = 1.0e0 )
205 t = one / (c + d * r)
206 p = sladiv2(a, b, c, d, r, t)
208 q = sladiv2(b, a, c, d, r, t)
216 REAL FUNCTION sladiv2( A, B, C, D, R, T )
224 REAL A, B, C, D, R, T
231 parameter ( zero = 0.0e0 )
240 if( br.NE.zero )
THEN
246 sladiv2 = (a + d * (b / c)) * t
subroutine sladiv(A, B, C, D, P, Q)
SLADIV performs complex division in real arithmetic, avoiding unnecessary overflow.
real function sladiv2(A, B, C, D, R, T)
subroutine sladiv1(A, B, C, D, P, Q)