|
kusano |
7d535a |
#include "f2c.h"
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* Subroutine */ int dlabad_(doublereal *small, doublereal *large)
|
|
kusano |
7d535a |
{
|
|
kusano |
7d535a |
/* -- LAPACK auxiliary routine (version 2.0) --
|
|
kusano |
7d535a |
Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
|
|
kusano |
7d535a |
Courant Institute, Argonne National Lab, and Rice University
|
|
kusano |
7d535a |
October 31, 1992
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Purpose
|
|
kusano |
7d535a |
=======
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
DLABAD takes as input the values computed by SLAMCH for underflow and
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
overflow, and returns the square root of each of these values if the
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
log of LARGE is sufficiently large. This subroutine is intended to
|
|
kusano |
7d535a |
identify machines with a large exponent range, such as the Crays, and
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
redefine the underflow and overflow limits to be the square roots of
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
the values computed by DLAMCH. This subroutine is needed because
|
|
kusano |
7d535a |
DLAMCH does not compensate for poor arithmetic in the upper half of
|
|
kusano |
7d535a |
the exponent range, as is found on a Cray.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Arguments
|
|
kusano |
7d535a |
=========
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
SMALL (input/output) DOUBLE PRECISION
|
|
kusano |
7d535a |
On entry, the underflow threshold as computed by DLAMCH.
|
|
kusano |
7d535a |
On exit, if LOG10(LARGE) is sufficiently large, the square
|
|
kusano |
7d535a |
root of SMALL, otherwise unchanged.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
LARGE (input/output) DOUBLE PRECISION
|
|
kusano |
7d535a |
On entry, the overflow threshold as computed by DLAMCH.
|
|
kusano |
7d535a |
On exit, if LOG10(LARGE) is sufficiently large, the square
|
|
kusano |
7d535a |
root of LARGE, otherwise unchanged.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
=====================================================================
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
If it looks like we're on a Cray, take the square root of
|
|
kusano |
7d535a |
SMALL and LARGE to avoid overflow and underflow problems. */
|
|
kusano |
7d535a |
/* Builtin functions */
|
|
kusano |
7d535a |
double d_lg10(doublereal *), sqrt(doublereal);
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
if (d_lg10(large) > 2e3) {
|
|
kusano |
7d535a |
*small = sqrt(*small);
|
|
kusano |
7d535a |
*large = sqrt(*large);
|
|
kusano |
7d535a |
}
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
return 0;
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
/* End of DLABAD */
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
} /* dlabad_ */
|
|
kusano |
7d535a |
|