Chapter 15: Expressions and The Expression Stack
171
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
•
CHS_TAG (change sign or negation) is replaced by a multiplication by minus
one. Thus,
L
x is replaced by
L
1 * x.
•
SUBTRACT_TAG is replaced by addition of a negative operand. Thus, x
N
2
is replaced by x + (
L
2). The expression x
N
y is replaced by x + (
L
1
†
y).
•
DIVIDE_TAG is replaced by multiplication by the denominator raised to the
minus one power. Thus, x / y is replaced by x * (y ^
L
1).
•
E_TAG, which represents the base
e
of the natural logarithms, is replaced by
the exponential function exp( ) represented by EXP_TAG. EXP_TAG is an
internal only tag and never occurs in the external tokenized form. Thus,
e
^x is
replaced by exp(x). When the symbol
e
occurs other than as a base for
exponentiation, it is replaced by exp(1). Thus,
e
+ x is replaced by exp(1) + x.
•
Hyperbolic function tags (SINH_TAG, COSH_TAG, TANH_TAG) are
replaced by the equivalent exponential expressions.
Sinh(x) is replaced by exp(x) * (1 / 2) + exp(x) ^ (
L
1) * (
L
1 / 2).
Cosh(x) is replaced by exp(x) * (1 / 2) + exp(x) ^ (
L
1) * (1 / 2).
Tanh(x) is replaced by ((exp(x)) ^ 2 + 1) ^ (
L
1) * ((exp(x)) ^ 2 + (
L
1))
•
LOG_TAG, which represents the base-ten logarithm function log( ), is
replaced by the equivalent natural logarithm expression. Thus, log(x) is
replaced by ln(x)
†
(ln(10)^(
L
1)).
•
SIN_TAG, COS_TAG, and TAN_TAG are replaced by equivalent
expressions using a two-argument tag called SIN2_TAG. SIN2_TAG is an
internal only tag that represents the function sin2(x, k) defined as sin(
x + (k
†
π
/ 2)). Since cos( ) can be represented as a shifted sin( ), and since
tan( ) can be represented as a ratio of sin( ) and cos( ), sin2( ) is used to
represent them all. The representation is SIN2_TAG on top of the
representation of the first argument x on top of the representation of the shift
argument k. Thus, sin(x) becomes sin2(x, 0); cos(x) becomes sin2(x, 1);
tan(x) becomes sin2(x, 0) * sin2(x, 1)^(
L
1).
•
I_TAG, which represents the imaginary number (
√
(
L
1)), is replaced by an
equivalent expression using a two-argument tag called IM_RE_TAG.
IM_RE_TAG is an internal only tag whose two arguments are the real and
imaginary parts of an expression. The real and imaginary parts must be real
values. Thus, the expression x +
i
…
y tokenizes as X_VAR_TAG I_TAG
Y_VAR_TAG MULTIPLY_TAG ADD_TAG. Since the system assumes that
the variables x and y are real, the simplifier replaces this external form with
the internal form X_VAR_TAG Y_VAR_TAG IM_RE_TAG.