90 SUBROUTINE sladiv( A, B, C, D, P, Q )
104 parameter( bs = 2.0e0 )
106 parameter( half = 0.5e0 )
108 parameter( two = 2.0e0 )
111 REAL AA, BB, CC, DD, AB, CD, S, OV, UN, BE, EPS
129 ab = max( abs(a), abs(b) )
130 cd = max( abs(c), abs(d) )
133 ov = slamch(
'Overflow threshold' )
134 un = slamch(
'Safe minimum' )
135 eps = slamch(
'Epsilon' )
138 IF( ab >= half*ov )
THEN
143 IF( cd >= half*ov )
THEN
148 IF( ab <= un*bs/eps )
THEN
153 IF( cd <= un*bs/eps )
THEN
158 IF( abs( d ).LE.abs( c ) )
THEN
159 CALL sladiv1(aa, bb, cc, dd, p, q)
161 CALL sladiv1(bb, aa, dd, cc, p, q)
183 REAL A, B, C, D, P, Q
190 parameter( one = 1.0e0 )
202 t = one / (c + d * r)
203 p = sladiv2(a, b, c, d, r, t)
205 q = sladiv2(b, a, c, d, r, t)
222 REAL a, b, c, d, r, t
229 parameter( zero = 0.0e0 )
238 if( br.NE.zero )
THEN
244 sladiv2 = (a + d * (b / c)) * t
real function sladiv2(a, b, c, d, r, t)
subroutine sladiv1(a, b, c, d, p, q)
subroutine sladiv(a, b, c, d, p, q)
SLADIV performs complex division in real arithmetic, avoiding unnecessary overflow.