summaryrefslogtreecommitdiff
path: root/numpy/linalg/lapack_lite/dlamch.c
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:16:06 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-08-18 11:20:45 -0600
commit8ddb0ce0acafe75d78df528b4d2540dfbf4b364d (patch)
tree156b23f48f14c7c1df699874007c521b5482d1a4 /numpy/linalg/lapack_lite/dlamch.c
parent13b0b272f764c14bc4ac34f5b19fd030d9c611a4 (diff)
downloadnumpy-8ddb0ce0acafe75d78df528b4d2540dfbf4b364d.tar.gz
STY: Giant whitespace cleanup.
Now is as good a time as any with open PR's at a low.
Diffstat (limited to 'numpy/linalg/lapack_lite/dlamch.c')
-rw-r--r--numpy/linalg/lapack_lite/dlamch.c548
1 files changed, 274 insertions, 274 deletions
diff --git a/numpy/linalg/lapack_lite/dlamch.c b/numpy/linalg/lapack_lite/dlamch.c
index bf1dfdb05..fd2d58ad7 100644
--- a/numpy/linalg/lapack_lite/dlamch.c
+++ b/numpy/linalg/lapack_lite/dlamch.c
@@ -5,49 +5,49 @@
#ifndef HAVE_CONFIG
doublereal dlamch_(char *cmach)
{
-/* -- LAPACK auxiliary routine (version 3.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
-
-
- Purpose
- =======
-
- DLAMCH determines double precision machine parameters.
-
- Arguments
- =========
-
- CMACH (input) CHARACTER*1
- Specifies the value to be returned by DLAMCH:
- = 'E' or 'e', DLAMCH := eps
- = 'S' or 's , DLAMCH := sfmin
- = 'B' or 'b', DLAMCH := base
- = 'P' or 'p', DLAMCH := eps*base
- = 'N' or 'n', DLAMCH := t
- = 'R' or 'r', DLAMCH := rnd
- = 'M' or 'm', DLAMCH := emin
- = 'U' or 'u', DLAMCH := rmin
- = 'L' or 'l', DLAMCH := emax
- = 'O' or 'o', DLAMCH := 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)
-
- =====================================================================
+/* -- LAPACK auxiliary routine (version 3.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
+
+
+ Purpose
+ =======
+
+ DLAMCH determines double precision machine parameters.
+
+ Arguments
+ =========
+
+ CMACH (input) CHARACTER*1
+ Specifies the value to be returned by DLAMCH:
+ = 'E' or 'e', DLAMCH := eps
+ = 'S' or 's , DLAMCH := sfmin
+ = 'B' or 'b', DLAMCH := base
+ = 'P' or 'p', DLAMCH := eps*base
+ = 'N' or 'n', DLAMCH := t
+ = 'R' or 'r', DLAMCH := rnd
+ = 'M' or 'm', DLAMCH := emin
+ = 'U' or 'u', DLAMCH := rmin
+ = 'L' or 'l', DLAMCH := emax
+ = 'O' or 'o', DLAMCH := 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)
+
+ =====================================================================
*/
-/* >>Start of File<<
+/* >>Start of File<<
Initialized data */
static logical first = TRUE_;
/* System generated locals */
@@ -64,7 +64,7 @@ doublereal dlamch_(char *cmach)
static doublereal rmin, rmax, t, rmach;
extern logical lsame_(char *, char *);
static doublereal small, sfmin;
- extern /* Subroutine */ int dlamc2_(integer *, integer *, logical *,
+ extern /* Subroutine */ int dlamc2_(integer *, integer *, logical *,
doublereal *, integer *, doublereal *, integer *, doublereal *);
static integer it;
static doublereal rnd, eps;
@@ -93,7 +93,7 @@ doublereal dlamch_(char *cmach)
if (small >= sfmin) {
/* Use SMALL plus a bit, to avoid the possibility of rou
-nding
+nding
causing overflow when computing 1/sfmin. */
sfmin = small * (eps + 1.);
@@ -130,56 +130,56 @@ nding
} /* dlamch_ */
-/* Subroutine */ int dlamc1_(integer *beta, integer *t, logical *rnd, logical
+/* Subroutine */ int dlamc1_(integer *beta, integer *t, logical *rnd, logical
*ieee1)
{
-/* -- LAPACK auxiliary routine (version 3.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
+/* -- LAPACK auxiliary routine (version 3.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
- Purpose
- =======
+ Purpose
+ =======
- DLAMC1 determines the machine parameters given by BETA, T, RND, and
- IEEE1.
+ DLAMC1 determines the machine parameters given by BETA, T, RND, and
+ IEEE1.
- Arguments
- =========
+ Arguments
+ =========
- BETA (output) INTEGER
- The base of the machine.
+ BETA (output) INTEGER
+ The base of the machine.
- T (output) INTEGER
- The number of ( BETA ) digits in the mantissa.
+ T (output) INTEGER
+ The number of ( BETA ) digits in the mantissa.
- RND (output) LOGICAL
- Specifies whether proper rounding ( RND = .TRUE. ) or
- chopping ( RND = .FALSE. ) occurs in addition. This may not
-
- be a reliable guide to the way in which the machine performs
-
- its arithmetic.
+ RND (output) LOGICAL
+ Specifies whether proper rounding ( RND = .TRUE. ) or
+ chopping ( RND = .FALSE. ) occurs in addition. This may not
- IEEE1 (output) LOGICAL
- Specifies whether rounding appears to be done in the IEEE
- 'round to nearest' style.
+ be a reliable guide to the way in which the machine performs
- Further Details
- ===============
+ its arithmetic.
- The routine is based on the routine ENVRON by Malcolm and
- incorporates suggestions by Gentleman and Marovich. See
+ IEEE1 (output) LOGICAL
+ Specifies whether rounding appears to be done in the IEEE
+ 'round to nearest' style.
- Malcolm M. A. (1972) Algorithms to reveal properties of
- floating-point arithmetic. Comms. of the ACM, 15, 949-951.
+ Further Details
+ ===============
- 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.
+ The 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.
+
+ =====================================================================
*/
/* Initialized data */
static logical first = TRUE_;
@@ -203,18 +203,18 @@ nding
one = 1.;
/* LBETA, LIEEE1, LT and LRND are the local values of BE
-TA,
- IEEE1, T and RND.
+TA,
+ IEEE1, T and RND.
Throughout this routine we use the function DLAMC3 to ens
-ure
- that relevant values are stored and not held in registers,
- or
- are not affected by optimizers.
+ure
+ that relevant values are stored and not held in registers,
+ or
+ are not affected by optimizers.
Compute a = 2.0**m with the smallest positive integer m s
-uch
- that
+uch
+ that
fl( a + 1.0 ) = a. */
@@ -230,11 +230,11 @@ L10:
c = dlamc3_(&c, &d__1);
goto L10;
}
-/* + END WHILE
+/* + END WHILE
- Now compute b = 2.0**m with the smallest positive integer
-m
- such that
+ Now compute b = 2.0**m with the smallest positive integer
+m
+ such that
fl( a + b ) .gt. a. */
@@ -248,14 +248,14 @@ L20:
c = dlamc3_(&a, &b);
goto L20;
}
-/* + END WHILE
+/* + END WHILE
Now compute the base. a and c are neighbouring floating po
-int
+int
numbers in the interval ( beta**t, beta**( t + 1 ) ) and
- so
+ so
their difference is beta. Adding 0.25 to c is to ensure that
- it
+ it
is truncated to beta and not ( beta - 1 ). */
qtr = one / 4;
@@ -265,8 +265,8 @@ int
lbeta = (integer) (c + qtr);
/* Now determine whether rounding or chopping occurs, by addin
-g a
- bit less than beta/2 and a bit more than beta/2 to
+g a
+ bit less than beta/2 and a bit more than beta/2 to
a. */
b = (doublereal) lbeta;
@@ -288,13 +288,13 @@ g a
}
/* Try and decide whether rounding is done in the IEEE 'round
- to
- nearest' style. B/2 is half a unit in the last place of the
-two
- numbers A and SAVEC. Furthermore, A is even, i.e. has last
-bit
+ to
+ nearest' style. B/2 is half a unit in the last place of the
+two
+ numbers A and SAVEC. Furthermore, A is even, i.e. has last
+bit
zero, and SAVEC is odd. Thus adding B/2 to A should not cha
-nge
+nge
A, but adding B/2 to SAVEC should change SAVEC. */
d__1 = b / 2;
@@ -304,12 +304,12 @@ nge
lieee1 = t1 == a && t2 > savec && lrnd;
/* Now find the mantissa, t. It should be the integer part
- of
+ of
log to the base beta of a, however it is safer to determine
- t
- by powering. So we find t as the smallest positive integer
-for
- which
+ t
+ by powering. So we find t as the smallest positive integer
+for
+ which
fl( beta**t + 1.0 ) = 1.0. */
@@ -342,73 +342,73 @@ L30:
} /* dlamc1_ */
-/* Subroutine */ int dlamc2_(integer *beta, integer *t, logical *rnd,
- doublereal *eps, integer *emin, doublereal *rmin, integer *emax,
+/* Subroutine */ int dlamc2_(integer *beta, integer *t, logical *rnd,
+ doublereal *eps, integer *emin, doublereal *rmin, integer *emax,
doublereal *rmax)
{
-/* -- LAPACK auxiliary routine (version 3.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
+/* -- LAPACK auxiliary routine (version 3.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
+
+
+ Purpose
+ =======
+
+ DLAMC2 determines the machine parameters specified in its argument
+ list.
+ Arguments
+ =========
- Purpose
- =======
+ BETA (output) INTEGER
+ The base of the machine.
- DLAMC2 determines the machine parameters specified in its argument
- list.
+ T (output) INTEGER
+ The number of ( BETA ) digits in the mantissa.
- Arguments
- =========
+ RND (output) LOGICAL
+ Specifies whether proper rounding ( RND = .TRUE. ) or
+ chopping ( RND = .FALSE. ) occurs in addition. This may not
- BETA (output) INTEGER
- The base of the machine.
+ be a reliable guide to the way in which the machine performs
- T (output) INTEGER
- The number of ( BETA ) digits in the mantissa.
+ its arithmetic.
- RND (output) LOGICAL
- Specifies whether proper rounding ( RND = .TRUE. ) or
- chopping ( RND = .FALSE. ) occurs in addition. This may not
-
- be a reliable guide to the way in which the machine performs
-
- its arithmetic.
+ EPS (output) DOUBLE PRECISION
+ The smallest positive number such that
- EPS (output) DOUBLE PRECISION
- The smallest positive number such that
+ fl( 1.0 - EPS ) .LT. 1.0,
- fl( 1.0 - EPS ) .LT. 1.0,
+ where fl denotes the computed value.
- where fl denotes the computed value.
+ EMIN (output) INTEGER
+ The minimum exponent before (gradual) underflow occurs.
- EMIN (output) INTEGER
- The minimum exponent before (gradual) underflow occurs.
+ RMIN (output) DOUBLE PRECISION
+ The smallest normalized number for the machine, given by
+ BASE**( EMIN - 1 ), where BASE is the floating point value
- RMIN (output) DOUBLE PRECISION
- The smallest normalized number for the machine, given by
- BASE**( EMIN - 1 ), where BASE is the floating point value
-
- of BETA.
+ of BETA.
- EMAX (output) INTEGER
- The maximum exponent before overflow occurs.
+ EMAX (output) INTEGER
+ The maximum exponent before overflow occurs.
- RMAX (output) DOUBLE PRECISION
- The largest positive number for the machine, given by
- BASE**EMAX * ( 1 - EPS ), where BASE is the floating point
-
- value of BETA.
+ RMAX (output) DOUBLE PRECISION
+ The largest positive number for the machine, given by
+ BASE**EMAX * ( 1 - EPS ), where BASE is the floating point
- Further Details
- ===============
+ value of BETA.
- The computation of EPS is based on a routine PARANOIA by
- W. Kahan of the University of California at Berkeley.
+ Further Details
+ ===============
- =====================================================================
+ The computation of EPS is based on a routine PARANOIA by
+ W. Kahan of the University of California at Berkeley.
+
+ =====================================================================
*/
-
+
/* Initialized data */
static logical first = TRUE_;
static logical iwarn = FALSE_;
@@ -428,12 +428,12 @@ L30:
static doublereal small;
static integer gpmin;
static doublereal third, lrmin, lrmax, sixth;
- extern /* Subroutine */ int dlamc1_(integer *, integer *, logical *,
+ extern /* Subroutine */ int dlamc1_(integer *, integer *, logical *,
logical *);
extern doublereal dlamc3_(doublereal *, doublereal *);
static logical lieee1;
- extern /* Subroutine */ int dlamc4_(integer *, doublereal *, integer *),
- dlamc5_(integer *, integer *, integer *, logical *, integer *,
+ extern /* Subroutine */ int dlamc4_(integer *, doublereal *, integer *),
+ dlamc5_(integer *, integer *, integer *, logical *, integer *,
doublereal *);
static integer lt, ngnmin, ngpmin;
static doublereal one, two;
@@ -447,16 +447,16 @@ L30:
two = 2.;
/* LBETA, LT, LRND, LEPS, LEMIN and LRMIN are the local values
- of
- BETA, T, RND, EPS, EMIN and RMIN.
+ of
+ BETA, T, RND, EPS, EMIN and RMIN.
Throughout this routine we use the function DLAMC3 to ens
-ure
- that relevant values are stored and not held in registers,
- or
- are not affected by optimizers.
+ure
+ that relevant values are stored and not held in registers,
+ or
+ are not affected by optimizers.
- DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1.
+ DLAMC1 returns the parameters LBETA, LT, LRND and LIEEE1.
*/
dlamc1_(&lbeta, &lt, &lrnd, &lieee1);
@@ -511,12 +511,12 @@ L10:
leps = a;
}
-/* Computation of EPS complete.
+/* Computation of EPS complete.
Now find EMIN. Let A = + or - 1, and + or - (1 + BASE**(-3
-)).
+)).
Keep dividing A by BETA until (gradual) underflow occurs. T
-his
+his
is detected when we cannot recover the previous A. */
rbase = one / lbeta;
@@ -539,13 +539,13 @@ his
if (ngpmin == gpmin) {
lemin = ngpmin;
/* ( Non twos-complement machines, no gradual under
-flow;
+flow;
e.g., VAX ) */
} else if (gpmin - ngpmin == 3) {
lemin = ngpmin - 1 + lt;
ieee = TRUE_;
/* ( Non twos-complement machines, with gradual und
-erflow;
+erflow;
e.g., IEEE standard followers ) */
} else {
lemin = min(ngpmin,gpmin);
@@ -557,7 +557,7 @@ erflow;
if ((i__1 = ngpmin - ngnmin, abs(i__1)) == 1) {
lemin = max(ngpmin,ngnmin);
/* ( Twos-complement machines, no gradual underflow
-;
+;
e.g., CYBER 205 ) */
} else {
lemin = min(ngpmin,ngnmin);
@@ -570,7 +570,7 @@ erflow;
if (gpmin - min(ngpmin,ngnmin) == 3) {
lemin = max(ngpmin,ngnmin) - 1 + lt;
/* ( Twos-complement machines with gradual underflo
-w;
+w;
no known machine ) */
} else {
lemin = min(ngpmin,ngnmin);
@@ -585,33 +585,33 @@ w;
/* ( A guess; no known machine ) */
iwarn = TRUE_;
}
-/* **
+/* **
Comment out this if block if EMIN is ok */
if (iwarn) {
first = TRUE_;
printf("\n\n WARNING. The value EMIN may be incorrect:- ");
printf("EMIN = %8i\n",lemin);
printf("If, after inspection, the value EMIN looks acceptable");
- printf("please comment out \n the IF block as marked within the");
- printf("code of routine DLAMC2, \n otherwise supply EMIN");
+ printf("please comment out \n the IF block as marked within the");
+ printf("code of routine DLAMC2, \n otherwise supply EMIN");
printf("explicitly.\n");
}
-/* **
+/* **
Assume IEEE arithmetic if we found denormalised numbers abo
-ve,
+ve,
or if arithmetic seems to round in the IEEE style, determi
-ned
+ned
in routine DLAMC1. A true IEEE machine should have both thi
-ngs
+ngs
true; however, faulty machines may have one or the other. */
ieee = ieee || lieee1;
/* Compute RMIN by successive division by BETA. We could comp
-ute
+ute
RMIN as BASE**( EMIN - 1 ), but some machines underflow dur
-ing
+ing
this computation. */
lrmin = 1.;
@@ -647,30 +647,30 @@ ing
doublereal dlamc3_(doublereal *a, doublereal *b)
{
-/* -- LAPACK auxiliary routine (version 3.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
+/* -- LAPACK auxiliary routine (version 3.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
+
+
+ Purpose
+ =======
+ DLAMC3 is intended to force A and B to be stored prior to doing
- Purpose
- =======
+ the addition of A and B , for use in situations where optimizers
- DLAMC3 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.
+ might hold one of these in a register.
- Arguments
- =========
+ Arguments
+ =========
- A, B (input) DOUBLE PRECISION
- The values A and B.
+ A, B (input) DOUBLE PRECISION
+ The values A and B.
- =====================================================================
+ =====================================================================
*/
-/* >>Start of File<<
+/* >>Start of File<<
System generated locals */
volatile doublereal ret_val;
@@ -688,33 +688,33 @@ doublereal dlamc3_(doublereal *a, doublereal *b)
#ifndef HAVE_CONFIG
/* Subroutine */ int dlamc4_(integer *emin, doublereal *start, integer *base)
{
-/* -- LAPACK auxiliary routine (version 2.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
+/* -- LAPACK auxiliary routine (version 2.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
- Purpose
- =======
+ Purpose
+ =======
- DLAMC4 is a service routine for DLAMC2.
+ DLAMC4 is a service routine for DLAMC2.
- Arguments
- =========
+ Arguments
+ =========
- EMIN (output) EMIN
- The minimum exponent before (gradual) underflow, computed by
-
- setting A = START and dividing by BASE until the previous A
- can not be recovered.
+ EMIN (output) EMIN
+ The minimum exponent before (gradual) underflow, computed by
- START (input) DOUBLE PRECISION
- The starting point for determining EMIN.
+ setting A = START and dividing by BASE until the previous A
+ can not be recovered.
- BASE (input) INTEGER
- The base of the machine.
+ START (input) DOUBLE PRECISION
+ The starting point for determining EMIN.
- =====================================================================
+ BASE (input) INTEGER
+ The base of the machine.
+
+ =====================================================================
*/
/* System generated locals */
integer i__1;
@@ -739,7 +739,7 @@ doublereal dlamc3_(doublereal *a, doublereal *b)
c2 = a;
d1 = a;
d2 = a;
-/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND.
+/* + WHILE( ( C1.EQ.A ).AND.( C2.EQ.A ).AND.
$ ( D1.EQ.A ).AND.( D2.EQ.A ) )LOOP */
L10:
if (c1 == a && c2 == a && d1 == a && d2 == a) {
@@ -776,60 +776,60 @@ L10:
} /* dlamc4_ */
-/* Subroutine */ int dlamc5_(integer *beta, integer *p, integer *emin,
+/* Subroutine */ int dlamc5_(integer *beta, integer *p, integer *emin,
logical *ieee, integer *emax, doublereal *rmax)
{
-/* -- LAPACK auxiliary routine (version 3.0) --
- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
- Courant Institute, Argonne National Lab, and Rice University
- October 31, 1992
+/* -- LAPACK auxiliary routine (version 3.0) --
+ Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
+ Courant Institute, Argonne National Lab, and Rice University
+ October 31, 1992
+
+
+ Purpose
+ =======
+ DLAMC5 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. It will fail on machines where this
+ assumption does not hold, for example, the Cyber 205 (EMIN = -28625,
- Purpose
- =======
+ EMAX = 28718). It will also fail if the value supplied for EMIN is
+ too large (i.e. too close to zero), probably with overflow.
- DLAMC5 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. 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 for EMIN is
- too large (i.e. too close to zero), probably with overflow.
+ Arguments
+ =========
- Arguments
- =========
+ BETA (input) INTEGER
+ The base of floating-point arithmetic.
- BETA (input) INTEGER
- The base of floating-point arithmetic.
+ P (input) INTEGER
+ The number of base BETA digits in the mantissa of a
+ floating-point value.
- P (input) INTEGER
- The number of base BETA digits in the mantissa of a
- floating-point value.
+ EMIN (input) INTEGER
+ The minimum exponent before (gradual) underflow.
- EMIN (input) INTEGER
- The minimum exponent before (gradual) underflow.
+ IEEE (input) LOGICAL
+ A logical flag specifying whether or not the arithmetic
+ system is thought to comply with the IEEE standard.
- IEEE (input) LOGICAL
- A logical flag specifying whether or not the arithmetic
- system is thought to comply with the IEEE standard.
+ EMAX (output) INTEGER
+ The largest exponent before overflow
- EMAX (output) INTEGER
- The largest exponent before overflow
+ RMAX (output) DOUBLE PRECISION
+ The largest machine floating-point number.
- RMAX (output) DOUBLE PRECISION
- The largest machine floating-point number.
+ =====================================================================
- =====================================================================
-
- First compute LEXP and UEXP, two powers of 2 that bound
- abs(EMIN). We then assume that EMAX + abs(EMIN) will sum
- approximately to the bound that is closest to abs(EMIN).
+ First compute LEXP and UEXP, two powers of 2 that bound
+ abs(EMIN). We then assume that EMAX + abs(EMIN) will sum
+ approximately to the bound that is closest to abs(EMIN).
(EMAX is the exponent of the required number RMAX). */
/* Table of constant values */
static doublereal c_b5 = 0.;
-
+
/* System generated locals */
integer i__1;
doublereal d__1;
@@ -861,8 +861,8 @@ L10:
++exbits;
}
-/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater
- than or equal to EMIN. EXBITS is the number of bits needed to
+/* Now -LEXP is less than or equal to EMIN, and -UEXP is greater
+ than or equal to EMIN. EXBITS is the number of bits needed to
store the exponent. */
if (uexp + *emin > -lexp - *emin) {
@@ -871,32 +871,32 @@ L10:
expsum = uexp << 1;
}
-/* EXPSUM is the exponent range, approximately equal to
+/* EXPSUM is the exponent range, approximately equal to
EMAX - EMIN + 1 . */
*emax = expsum + *emin - 1;
nbits = exbits + 1 + *p;
-/* NBITS is the total number of bits needed to store a
+/* NBITS is the total number of bits needed to store a
floating-point number. */
if (nbits % 2 == 1 && *beta == 2) {
-/* Either there are an odd number of bits used to store a
- floating-point number, which is unlikely, or some bits are
-
+/* Either there are an odd number of bits used to store a
+ floating-point number, which is unlikely, or some bits are
+
not used in the representation of numbers, which is possible
-,
- (e.g. Cray machines) or the mantissa has an implicit bit,
+,
+ (e.g. Cray machines) or the mantissa has an implicit bit,
(e.g. IEEE machines, Dec Vax machines), which is perhaps the
-
- most likely. We have to assume the last alternative.
- If this is true, then we need to reduce EMAX by one because
-
+
+ most likely. We have to assume the last alternative.
+ If this is true, then we need to reduce EMAX by one because
+
there must be some way of representing zero in an implicit-b
-it
- system. On machines like Cray, we are reducing EMAX by one
-
+it
+ system. On machines like Cray, we are reducing EMAX by one
+
unnecessarily. */
--(*emax);
@@ -905,16 +905,16 @@ it
if (*ieee) {
/* Assume we are on an IEEE machine which reserves one exponent
-
+
for infinity and NaN. */
--(*emax);
}
-/* Now create RMAX, the largest machine number, which should
- be equal to (1.0 - BETA**(-P)) * BETA**EMAX .
+/* Now create RMAX, the largest machine number, which should
+ be equal to (1.0 - BETA**(-P)) * BETA**EMAX .
- First compute 1.0 - BETA**(-P), being careful that the
+ First compute 1.0 - BETA**(-P), being careful that the
result is less than 1.0 . */
recbas = 1. / *beta;