|
444. MATH: Math Processing Facility
by Douglas R. Henry and Peter C. Jurs, Department of
Chemistry, Pennsylvania State University, University
Park, Pennsylvania 16802
This program implements a function translator,
postfixer, and evaluator for FORTRAN-like assignment
statements of the form
CALC, EXPRESSION
CALC, CNN = EXPRESSION
CALC, CNN (MM) = EXPRESSION
and IF-ELSE statements like
IF (LOGICAL EXPRESSION) = EXPRESSION
IF (LOGICAL EXPR) CN1 = EXPR1 ELSE CN2 = EXPR2
The statements are input by the user at run-time in the
form of commands. Processing is carried out on a 500
row by 20 column real data matrix, entirely by the
program, without resorting to the system FORTRAN
compiler or assembler. Thus, special functions can
easily be implemented. Expressions may be as nested or
complex as desired. Statements may be up to 80
characters in length, with up to 20 column and row
designators and up to 20 numeric constants (these
limits can be changed). All the standard operators +,
-, *, /, **, (, and ) can be used. The simple
functions ABS, EXP, LOG, LN, SQRT, SIN, COS, TAN, ASIN,
ACOS, ATAN, DEG (radians to degrees), RAD (degrees to
radians), INT (integer part), RND (round), and SGN
(sign) are available. The multi-argument functions MIN
and MAX (up to 9 arguments) and MOD (2 arguments) are
also implemented, as well as the logical operators
.LT., .EQ., .GT., .LE., .GE., .NE., .OR., and .AND..
Sample uses for this function translator include (1)
data manipulation for statistical and numerical
analysis, (2) run-time specification of a function to
be fit in a nonlinear regression analysis, and (3)
function definition for 2- and 3-D graphics
applications.
FORTRAN IV (IBM)
Lines of Code: 1908
|