MA01BD

Safely computing the general product of K real scalars

[Specification] [Arguments] [Method] [References] [Comments] [Example]

Purpose

  To compute the general product of K real scalars without over-
  or underflow.

Specification
      SUBROUTINE MA01BD( BASE, LGBAS, K, S, A, INCA, ALPHA, BETA, SCAL )
C     .. Scalar Arguments ..
      INTEGER           INCA, K, SCAL
      DOUBLE PRECISION  ALPHA, BASE, BETA, LGBAS
C     .. Array Arguments ..
      INTEGER           S(*)
      DOUBLE PRECISION  A(*)

Arguments

Input/Output Parameters

  BASE    (input)  DOUBLE PRECISION
          Machine base.

  LGBAS   (input)  DOUBLE PRECISION
          Logarithm of BASE.

  K       (input)  INTEGER
          The number of scalars.  K >= 1.

  S       (input)  INTEGER array, dimension (K)
          The signature array. Each entry of S must be 1 or -1.

  A       (input)  DOUBLE PRECISION array, dimension (K)
          Vector of real scalars.

  INCA    (input)  INTEGER
          Increment for the array A. INCA <> 0.

  ALPHA   (output)  DOUBLE PRECISION
          ALPHA is a real scalar such that

             ALPHA / BETA * BASE**(SCAL)

          is the general product of the scalars in the array A.

  BETA    (output)  DOUBLE PRECISION
          BETA is either 0.0 or 1.0.
          See also the description of ALPHA.

  SCAL    (output)  INTEGER
          Scaling factor exponent, see ALPHA.

Further Comments
  None
Example

Program Text

  None
Program Data
  None
Program Results
  None

Return to Supporting Routines index