Next: Installing SECOND and DSECND Up: Test and Install the Previous: Installing LSAME   Contents

### Installing SLAMCH and DLAMCH

SLAMCH and DLAMCH are real functions with a single character parameter that indicates the machine parameter to be returned. The test program in TSLAMCHF simply prints out the different values computed by SLAMCH, so you need to know something about what the values should be. For example, the output of the test program for SLAMCH on a Sun SPARCstation is
 Epsilon                      =     5.96046E-08
Safe minimum                 =     1.17549E-38
Base                         =     2.00000
Precision                    =     1.19209E-07
Number of digits in mantissa =     24.0000
Rounding mode                =     1.00000
Minimum exponent             =    -125.000
Underflow threshold          =     1.17549E-38
Largest exponent             =     128.000
Overflow threshold           =     3.40282E+38
Reciprocal of safe minimum   =     8.50706E+37

On a Cray machine, the safe minimum underflows its output representation and the overflow threshold overflows its output representation, so the safe minimum is printed as 0.00000 and overflow is printed as R. This is normal. If you would prefer to print a representable number, you can modify the test program to print SFMIN*100. and RMAX/100. for the safe minimum and overflow thresholds.

Compile SLAMCHF and TSLAMCHF and run the test program. If the results from the test program are correct, save SLAMCH for inclusion in the LAPACK library. Repeat these steps with DLAMCHF and TDLAMCHF. If both tests were successful, go to Section A.2.3.

If SLAMCH (or DLAMCH) returns an invalid value, you will have to create your own version of this function. The following options are used in LAPACK and must be set:

• B': Base of the machine
• E': Epsilon (relative machine precision)
• O': Overflow threshold
• P': Precision = Epsilon*Base
• S': Safe minimum (often same as underflow threshold)
• U': Underflow threshold

Some people may be familiar with R1MACH (D1MACH), a primitive routine for setting machine parameters in which the user must comment out the appropriate assignment statements for the target machine. If a version of R1MACH is on hand, the assignments in SLAMCH can be made to refer to R1MACH using the correspondence

• SLAMCH( U' ) 6#6 R1MACH( 1 )
• SLAMCH( O' ) 6#6 R1MACH( 2 )
• SLAMCH( E' ) 6#6 R1MACH( 3 )
• SLAMCH( B' ) 6#6 R1MACH( 5 )

The safe minimum returned by SLAMCH( 'S' ) is initially set to the underflow value, but if 7#7 it is recomputed as 8#8, where 9#9 is the machine precision.

Next: Installing SECOND and DSECND Up: Test and Install the Previous: Installing LSAME   Contents
Susan Blackford 2001-08-13