3 /* Subroutine */ int dlabad_(doublereal *small, doublereal *large)
5 /* Builtin functions */
6 double d_lg10(doublereal *), sqrt(doublereal);
9 /* -- LAPACK auxiliary routine (version 3.1) -- */
10 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
13 /* .. Scalar Arguments .. */
19 /* DLABAD takes as input the values computed by DLAMCH for underflow and */
20 /* overflow, and returns the square root of each of these values if the */
21 /* log of LARGE is sufficiently large. This subroutine is intended to */
22 /* identify machines with a large exponent range, such as the Crays, and */
23 /* redefine the underflow and overflow limits to be the square roots of */
24 /* the values computed by DLAMCH. This subroutine is needed because */
25 /* DLAMCH does not compensate for poor arithmetic in the upper half of */
26 /* the exponent range, as is found on a Cray. */
31 /* SMALL (input/output) DOUBLE PRECISION */
32 /* On entry, the underflow threshold as computed by DLAMCH. */
33 /* On exit, if LOG10(LARGE) is sufficiently large, the square */
34 /* root of SMALL, otherwise unchanged. */
36 /* LARGE (input/output) DOUBLE PRECISION */
37 /* On entry, the overflow threshold as computed by DLAMCH. */
38 /* On exit, if LOG10(LARGE) is sufficiently large, the square */
39 /* root of LARGE, otherwise unchanged. */
41 /* ===================================================================== */
43 /* .. Intrinsic Functions .. */
45 /* .. Executable Statements .. */
47 /* If it looks like we're on a Cray, take the square root of */
48 /* SMALL and LARGE to avoid overflow and underflow problems. */
50 if (d_lg10(large) > 2e3) {
51 *small = sqrt(*small);
52 *large = sqrt(*large);