90 SUBROUTINE dladiv( A, B, C, D, P, Q )
97 DOUBLE PRECISION A, B, C, D, P, Q
104 parameter( bs = 2.0d0 )
105 DOUBLE PRECISION HALF
106 parameter( half = 0.5d0 )
108 parameter( two = 2.0d0 )
111 DOUBLE PRECISION AA, BB, CC, DD, AB, CD, S, OV, UN, BE, EPS
114 DOUBLE PRECISION DLAMCH
129 ab = max( abs(a), abs(b) )
130 cd = max( abs(c), abs(d) )
133 ov = dlamch(
'Overflow threshold' )
134 un = dlamch(
'Safe minimum' )
135 eps = dlamch(
'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 dladiv1(aa, bb, cc, dd, p, q)
161 CALL dladiv1(bb, aa, dd, cc, p, q)
183 DOUBLE PRECISION A, B, C, D, P, Q
190 parameter( one = 1.0d0 )
193 DOUBLE PRECISION R, T
196 DOUBLE PRECISION DLADIV2
202 t = one / (c + d * r)
203 p = dladiv2(a, b, c, d, r, t)
205 q = dladiv2(b, a, c, d, r, t)
215 DOUBLE PRECISION FUNCTION dladiv2( A, B, C, D, R, T )
222 DOUBLE PRECISION a, b, c, d, r, t
228 DOUBLE PRECISION zero
229 parameter( zero = 0.0d0 )
238 IF( br.NE.zero )
THEN
244 dladiv2 = (a + d * (b / c)) * t
subroutine dladiv1(a, b, c, d, p, q)
double precision function dladiv2(a, b, c, d, r, t)
subroutine dladiv(a, b, c, d, p, q)
DLADIV performs complex division in real arithmetic, avoiding unnecessary overflow.