01:       SUBROUTINE DLABAD( SMALL, LARGE )
02: *
03: *  -- LAPACK auxiliary routine (version 3.2) --
04: *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
05: *     November 2006
06: *
07: *     .. Scalar Arguments ..
08:       DOUBLE PRECISION   LARGE, SMALL
09: *     ..
10: *
11: *  Purpose
12: *  =======
13: *
14: *  DLABAD takes as input the values computed by DLAMCH for underflow and
15: *  overflow, and returns the square root of each of these values if the
16: *  log of LARGE is sufficiently large.  This subroutine is intended to
17: *  identify machines with a large exponent range, such as the Crays, and
18: *  redefine the underflow and overflow limits to be the square roots of
19: *  the values computed by DLAMCH.  This subroutine is needed because
20: *  DLAMCH does not compensate for poor arithmetic in the upper half of
21: *  the exponent range, as is found on a Cray.
22: *
23: *  Arguments
24: *  =========
25: *
26: *  SMALL   (input/output) DOUBLE PRECISION
27: *          On entry, the underflow threshold as computed by DLAMCH.
28: *          On exit, if LOG10(LARGE) is sufficiently large, the square
29: *          root of SMALL, otherwise unchanged.
30: *
31: *  LARGE   (input/output) DOUBLE PRECISION
32: *          On entry, the overflow threshold as computed by DLAMCH.
33: *          On exit, if LOG10(LARGE) is sufficiently large, the square
34: *          root of LARGE, otherwise unchanged.
35: *
36: *  =====================================================================
37: *
38: *     .. Intrinsic Functions ..
39:       INTRINSIC          LOG10, SQRT
40: *     ..
41: *     .. Executable Statements ..
42: *
43: *     If it looks like we're on a Cray, take the square root of
44: *     SMALL and LARGE to avoid overflow and underflow problems.
45: *
46:       IF( LOG10( LARGE ).GT.2000.D0 ) THEN
47:          SMALL = SQRT( SMALL )
48:          LARGE = SQRT( LARGE )
49:       END IF
50: *
51:       RETURN
52: *
53: *     End of DLABAD
54: *
55:       END
56: