DATAMANIP commands


PROGRAM NAME

klogexp - Compute Logarithm and Exponential (Antilogarithm)

DESCRIPTION

klogexp computes the log/antilog(exponential) of the data represented in the value segment of an object. If the object has an associated mask, the operation will be gated so that the operation is done only on valid elements (indicated by non-zero mask values). A zero mask value will cause the value of the corresponding point in the input object to be transferred the output object.

Three standard-bases are provided, and alternate bases can be specified using the -base option. be returns the natural logarithm of x, and b2 and b10 return the log/antilog(exponential) to base 2 and 10 respectively.

The -offset option can be set to TRUE if the logarithm is to operate on the input value plus 1 (log(x+1) or if the antilog(exponential) should return the output with a 1 subtracted from it (base**(x)-1). This improves accuracy for very small input values.

SPECIAL NOTE: The log/antilog(exponential) function is not defined for base values less than or equal to zero. An error is returned if the base value is less than or equal to zero.

If the input object has a map segment, then the values in the map segment are modified directly according to the requested operation. In this case, the value segment data is not modified or referenced.

The output data type (of the map or value data, depending on which is modified) is always KDOUBLE (if the data is real) or KDCOMPLEX (if the data is complex).

REQUIRED ARGUMENTS

-i
type: infile
desc: input data object
-o
type: outfile
desc: resulting output data object

Mutually Exclusive Group; you must specify ONE of:

-be
type: flag
desc: Compute using base e (2.71828...)
OR
-b10
type: flag
desc: Compute using base 10
OR
-b2
type: flag
desc: Compute using base 2
OR
-base
type: double
desc: User Specified base
default: 2
bounds: no range checking

OPTIONAL ARGUMENTS

-inv
type: flag
desc: Compute inverse logarithm (exp)
-offset
type: boolean
desc: Operate either on value [False] or value+1 for log and value -1 for antilog [True]
default: true

EXAMPLES

SEE ALSO

karith1(1)

RESTRICTIONS

A complex base is not currently supported.

If the argument to the logarithm is found to be less than or equal to zero, a large negative number (-KMAXFLOAT) is returned.

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.