kusano 7d535a
#include "f2c.h"
kusano 7d535a
kusano 7d535a
/* Subroutine */ int slabad_(real *small, real *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
    SLABAD 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 SLAMCH.  This subroutine is needed because   
kusano 7d535a
    SLAMCH 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) REAL   
kusano 7d535a
            On entry, the underflow threshold as computed by SLAMCH.   
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) REAL   
kusano 7d535a
            On entry, the overflow threshold as computed by SLAMCH.   
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 r_lg10(real *), sqrt(doublereal);
kusano 7d535a
kusano 7d535a
kusano 7d535a
    if (r_lg10(large) > 2e3f) {
kusano 7d535a
	*small = sqrt(*small);
kusano 7d535a
	*large = sqrt(*large);
kusano 7d535a
    }
kusano 7d535a
kusano 7d535a
    return 0;
kusano 7d535a
kusano 7d535a
/*     End of SLABAD */
kusano 7d535a
kusano 7d535a
} /* slabad_ */
kusano 7d535a