comp2pui SciMax Toolbox compfile

SciMax Toolbox >> compare

compare

Maxima Function

Calling Sequence

compare (x, y)

Description

Return a comparison operator op (<, <=, >, >=, =, or #) such that is (x op y) evaluates to true; when either x or y depends on %i and x # y, return notcomparable; when there is no such operator or Maxima isn't able to determine the operator, return unknown.

Examples:

(%i1) compare (1, 2);
(%o1)                           <
(%i2) compare (1, x);
(%o2)                        unknown
(%i3) compare (%i, %i);
(%o3)                           =
(%i4) compare (%i, %i + 1);
(%o4)                     notcomparable
(%i5) compare (1/x, 0);
(%o5)                           #
(%i6) compare (x, abs(x));
(%o6)                          <=

The function compare doesn't try to determine whether the real domains of its arguments are nonempty; thus

(%i1) compare (acos (x^2 + 1), acos (x^2 + 1) + 1);
(%o1)                           <

The real domain of acos (x^2 + 1) is empty.

comp2pui SciMax Toolbox compfile