/home/abui...lamchf77.f(3)
π NAME
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/INSTALL/slamchf77.f
Okay so bestie, that whole entire path is the name β no cap, that's the whole vibe. This is the manual page for slamchf77.f from LAPACK, living in the Library Functions Manual, filed under /home/abui...lamchf77.f(3). It's giving "I contain six whole routines that sniff out your machine's floating-point parameters" and honestly? Iconic. β¨
πΈ SYNOPSIS β the cast list πΈ
π Functions/Subroutines π
real function SLAMCH (cmach)β the main character, does the actual parameter-determining πsubroutine SLAMC1 (beta, t, rnd, ieee1)β supporting role, findsBETA,T,RND,IEEE1subroutine SLAMC2 (beta, t, rnd, eps, emin, rmin, emax, rmax)β finds a whole pile of parametersreal function SLAMC3 (a, b)β tiny little helper that justβ¦ addsAandB, but dramaticallysubroutine SLAMC4 (emin, start, base)β service routine forSLAMC2, does theEMINmathsubroutine SLAMC5 (beta, p, emin, ieee, emax, rmax)β out here hunting forRMAXwithout overflow
π¦ Function/Subroutine Documentation π¦
π§ SLAMC1
subroutine SLAMC1 (integer beta, integer t, logical rnd, logical ieee1)
Purpose π
SLAMC1 figures out the machine parameters that come out as BETA, T, RND and IEEE1. That's literally the whole job. Slay.
Parameters π
BETAβ the base of the machine.Tβ the number of (BETA) digits in the mantissa.RNDβ tells you whether proper rounding (RND = .TRUE.) or chopping (RND = .FALSE.) happens in addition. Fr fr though, heads up: this may not be a reliable guide to the way in which the machine performs its arithmetic. So don't come for me if it's off πIEEE1β tells you whether rounding appears to be done in the IEEE'round to nearest'style.
Author π
LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
Further Details π₯
Lowkey a whole heritage moment β this routine is based on the routine ENVRON by Malcolm and incorporates suggestions by Gentleman and Marovich. See:
Malcolm M. A. (1972) Algorithms to reveal properties of
floating-point arithmetic. Comms. of the ACM, 15, 949-951.
Gentleman W. M. and Marovich S. B. (1974) More on algorithms
that reveal properties of floating point arithmetic units.
Comms. of the ACM, 17, 276-277.
Definition at line 206 of file slamchf77.f.
π§ SLAMC2
subroutine SLAMC2 (integer beta, integer t, logical rnd, real eps, integer emin,
real rmin, integer emax, real rmax)
Purpose π
SLAMC2 determines the machine parameters specified in its argument list. All of them. Every single one. π«Ά
Author π
LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
Parameters π
BETAβ the base of the machine.Tβ the number of (BETA) digits in the mantissa.RNDβ specifies whether proper rounding (RND = .TRUE.) or chopping (RND = .FALSE.) occurs in addition. Again, this may not be a reliable guide to the way in which the machine performs its arithmetic. Not me repeating the warning, it's literally in the source okay πEPSβ the smallest positive number such that
fl( 1.0 - EPS ) .LT. 1.0,
where fl denotes the computed value.
EMINβ the minimum exponent before (gradual) underflow occurs.RMINβ the smallest normalized number for the machine, given byBASE**( EMIN - 1 ), whereBASEis the floating point value ofBETA.EMAXβ the maximum exponent before overflow occurs.RMAXβ the largest positive number for the machine, given byBASE**EMAX * ( 1 - EPS ), whereBASEis the floating point value ofBETA.
Further Details π₯
The computation of EPS is based on a routine PARANOIA by W. Kahan of the University of California at Berkeley. Respect the lineage π
Definition at line 418 of file slamchf77.f.
π§ SLAMC3
real function SLAMC3 (real a, real b)
Purpose π
SLAMC3 is intended to force A and B to be stored prior to doing the addition of A and B, for use in situations where optimizers might hold one of these in a register. It's giving "I'm here to stop the optimizer from being too clever." Main character energy for a two-line addition, honestly. π
Author π
LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
Parameters π
Aβ (no description, it's just vibes and an empty line π« )Bβ the valuesAandB.
Purpose (yes, again) π
And because the docs said "encore", here it is one more time: SLAMC3 is intended to force A and B to be stored prior to doing the addition of A and B, for use in situations where optimizers might hold one of these in a register. Not me copy-pasting β they did, bestie.
Parameters (also again) π
ABβ the valuesAandB.
Definition at line 170 of file slamch.f. (note: slamch.f, not slamchf77.f β keeping it accurate π)
π§ SLAMC4
subroutine SLAMC4 (integer emin, real start, integer base)
Purpose π
SLAMC4 is a service routine for SLAMC2. Just out here doing the support work with zero credit β we see you, bestie. πΈ
Parameters π
EMINβ the minimum exponent before (gradual) underflow, computed by settingA = STARTand dividing byBASEuntil the previousAcan not be recovered.STARTβ the starting point for determiningEMIN.BASEβ the base of the machine.
Definition at line 688 of file slamchf77.f.
π§ SLAMC5
subroutine SLAMC5 (integer beta, integer p, integer emin, logical ieee,
integer emax, real rmax)
Purpose π
SLAMC5 attempts to compute RMAX, the largest machine floating-point number, without overflow. It assumes that EMAX + abs(EMIN) sum approximately to a power of 2.
β οΈ Heads up bestie, it will fail on machines where this assumption does not hold β for example, the Cyber 205 (EMIN = -28625,EMAX = 28718). It will also fail if the value supplied forEMINis too large (i.e. too close to zero), probably with overflow. So likeβ¦ know your machine, okay? π
Parameters π
BETAβ the base of floating-point arithmetic.Pβ the number of baseBETAdigits in the mantissa of a floating-point value.EMINβ the minimum exponent before (gradual) underflow.IEEEβ a logical flag specifying whether or not the arithmetic system is thought to comply with the IEEE standard.EMAXβ the largest exponent before overflow.RMAXβ the largest machine floating-point number.
Definition at line 796 of file slamchf77.f.
π SLAMCH β the actual headliner π
real function SLAMCH (character cmach)
SLAMCH SLAMCHF77 deprecated π¨ β yes she's deprecated, we still love her, but note it fr fr.
Purpose π
SLAMCH determines single precision machine parameters. Simple as that, and yet so much power.
Parameters π
CMACH is CHARACTER*1. Here's the whole menu, verbatim, because accuracy is the vibe:
Specifies the value to be returned by SLAMCH:
= 'E' or 'e', SLAMCH := eps
= 'S' or 's , SLAMCH := sfmin
= 'B' or 'b', SLAMCH := base
= 'P' or 'p', SLAMCH := eps*base
= 'N' or 'n', SLAMCH := t
= 'R' or 'r', SLAMCH := rnd
= 'M' or 'm', SLAMCH := emin
= 'U' or 'u', SLAMCH := rmin
= 'L' or 'l', SLAMCH := emax
= 'O' or 'o', SLAMCH := rmax
where
eps = relative machine precision
sfmin = safe minimum, such that 1/sfmin does not overflow
base = base of the machine
prec = eps*base
t = number of (base) digits in the mantissa
rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
emin = minimum exponent before (gradual) underflow
rmin = underflow threshold - base**(emin-1)
emax = largest exponent before overflow
rmax = overflow threshold - (base**emax)*(1-eps)
(Yes, 's , is written like that in the original. Leaving it exactly as found, don't @ me π
)
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Purpose (the sequel) π
SLAMCH determines single precision machine parameters. Same sentence, second time. We love consistency. π
Parameters (the sequel) π
CMACH β specifies the value to be returned by SLAMCH:
= 'E' or 'e', SLAMCH := eps
= 'S' or 's , SLAMCH := sfmin
= 'B' or 'b', SLAMCH := base
= 'P' or 'p', SLAMCH := eps*base
= 'N' or 'n', SLAMCH := t
= 'R' or 'r', SLAMCH := rnd
= 'M' or 'm', SLAMCH := emin
= 'U' or 'u', SLAMCH := rmin
= 'L' or 'l', SLAMCH := emax
= 'O' or 'o', SLAMCH := rmax
where
eps = relative machine precision
sfmin = safe minimum, such that 1/sfmin does not overflow
base = base of the machine
prec = eps*base
t = number of (base) digits in the mantissa
rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
emin = minimum exponent before (gradual) underflow
rmin = underflow threshold - base**(emin-1)
emax = largest exponent before overflow
rmax = overflow threshold - (base**emax)*(1-eps)
Author (the sequel) π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 67 of file slamch.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (Not written by a human hand, just Doxygen doing Doxygen things π«Ά)
And that's the whole page, bestie! π LAPACK, Version 3.12.0, brought to you by /home/abui...lamchf77.f(3) β go forth and know your machine's floating-point parameters β¨ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms