SLAMCH and DLAMCH are real functions with a single character parameter that indicates the machine parameter to be returned. The test program in slamchtst.f 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 executable testslamch 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+37On 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.
Likewise, the test executable testdlamch is run for DLAMCH.
If both tests were successful, go to Section 6.1.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:
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
The safe minimum returned by SLAMCH( 'S' ) is initially set to the underflow value, but if it is recomputed as , where is the machine precision.
BE AWARE that the initial call to SLAMCH or DLAMCH is expensive. We suggest that installers run it once, save the results, and hard-code the constants in the version they put in their library.