Appendix A: System Routines — Algebra Utilities
255
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
is_polynomial_in_var_or_kern
Declaration:
Boolean
is_polynomial_in_var_or_kern
(EStackIndex
i
, EStackIndex
vi
)
Category(ies):
Algebra Utilities
Description:
Determines whether the expression indexed by
i
is polynomial in the
variable or kernel indexed by
vi
, generalized to permit negative and
fractional powers of
vi
.
Inputs:
i
— Index of the top tag of an internally-simplified expression.
vi
— Index of the top tag of an internally-simplified variable or kernel.
Outputs:
Returns TRUE only if the expression indexed by
i
is polynomial in the
variable or kernel indexed by
vi
. Otherwise returns FALSE.
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: is_totally_polynomial
Example:
If
i
indexes x^-(3/2) + ln(y), then
is_polynomial_in_var_or_kern
returns
TRUE if
vi
indexes x or ln(y) or z, but returns FALSE if
vi
indexes y.
Boolean is_polynomial_in_var_or_kern (EStackIndex i, EStackIndex vi)
{ for (;;)
{ if (are_expressions_identical (i, vi) ||
IS_NUM_VAR_OR_ZERO_ARG_TAG (ESTACK (i)))
return TRUE;
if (EXPONENTIATION_TAG == ESTACK (i) &&
! (are_expressions_identical (vi, POWER_BASE_INDEX (i)) ||
is_whole_number (POWER_EXPONENT_INDEX (i)) ||
is_independent_of (POWER_BASE_INDEX (i), vi) ) )
return FALSE;
if (IS_ARITH_OR_POWER_TAG (ESTACK (i)) &&
is_polynomial_in_var_or_kern (i - 1u, vi) )
i = next_expression_index (i - 1u);
else return is_independent_of (i, vi);
}
}