728
Appendix A: System Routines — Logic
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
is_equivalent_to
Declaration:
Boolean
is_equivalent_to
(EStackIndex
i
, EStackIndex
j
)
Category(ies):
Logic
Description:
Determines whether the expressions indexed by
i
and
j
are identical or can
be determined by the CAS to be equivalent.
Inputs:
i, j
— Indices of the top tags of internally-simplified expressions or
strings.
Outputs:
Returns TRUE if the expressions indexed by
i
and
j
are identical or can be
determined by the CAS to be equivalent. Otherwise returns FALSE, even
though they might actually be equivalent.
Assumptions:
None
Side Effects:
None
Availability:
On AMS 2.02 and higher.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: compare_expressions, are_expressions_identical
Example:
push_quantum_as_nonnegative_int (2u);
exponent = top_estack;
push_quantum (8u); /* push x */
add1_to_top (); /* top_estack -> x + 1 */
replace_top2_with_pow (exponent);
unexpanded = top_estack; /* unexpanded -> (x + 1)^2 */
push_quantum_as_nonnegative_int (2u);
coefficient = top_estack;
push_quantum (8u); /* push x */
replace_top2_with prod (coefficient); /* top_estack -> 2 * x */
add1_to_top();
partial_sum = top_estack; /* partial_sum -> 2 * x + 1 */
push_quantum_as_nonnegative_int (2u);
exponent = top_estack;
push_quantum (8u); /* push x */
replace_top2_with_pow (exponent); /* top_estack -> x^2 */
replace_top2_with_sum (partial_sum); /* top_estack -> x^2 + 2 * x + 1 */
is_equivalent_to (top_estack, unexpanded); /* Returns TRUE */