is() problem



> IS(EQUAL(sin(x)/cos(x),tan(x))) =>
> MACSYMA was unable to evaluate the predicate

> Is this the normal behaviour?

Yes, this is normal behavior.  There are two issues here: why it gives
an error (rather than Unknown) and why it isn't using stronger equality
testing.

It gives an error because "is" evaluation is intended for program
control structures.  It is the same kind of evaluation as in "if ...".
In program control, the answer must be either True or False; it is not
useful given the current semantics to return Unknown.  With prederror
set to False, it will return Unknown if it cannot determine the answer.

Is/equal does not apply "strong" equality testing methods.  There is no
general-purpose strong zero-testing method in Maxima, because different
approaches are appropriate in different cases, some of them can be very
time-consuming, and some of them are not infallible.

Is/equal *does* apply stronger equality testing than is/= does, though.
is/= is strictly syntactic, so that is(x^2-1=(x-1)*(x+1)) and even
is(1/2=0.5) are false, while the same comparisons with equal are true.
(On the other hand, is/= also reports true in the case
taylor(x,x,0,1)=x, which I think it should not.)

The approaches include:

Ratsimp -- Effective for rational functions.  Is/equal uses this as well
as some other techniques.

Trigreduce(Trigsimp(expr)) -- effective for some trigonometric
expressions.

Trigrat -- very effective for a larger class of trigonometric
expressions.

Zeroequiv -- useful for univariate expressions of known, well-behaved
functions; uses numerical evaluation at randomly chosen points.  Not
infallible. (see
http://sourceforge.net/tracker/index.php?func=detail&aid=593530&group_id
=4933&atid=104933) Sometimes very slow
(http://sourceforge.net/tracker/index.php?func=detail&aid=626760&group_i
d=4933&atid=104933) -- this is probably a bug.

Radcan -- Useful for expressions involving radicals, exponentials, and
logs; for a large class of such expressions, it is documented to return
zero if the expression is in fact zero (I am not sure this is true, or
at least that the large class in question is well-defined).  Can be very
slow -- not a bug, it is doing a combinatorial search.  Can be useful
combined with exponentialize and logarc in dealing with
trigonometric/hyperbolic functions.  Sometimes makes errors because of
incorrect choice of branches.

Taylor -- Often effective, especially for univariate expressions.  But
it does require some a priori knowledge about what the lowest-order term
might be.  For example, taylor(x^1000,x,0,10) doesn't tell you anything
useful.

All of these approaches work on sin(x)/cos(x)-tan(x).  Note that
equations per se (a=b) are not simplified, so the first thing to do is
convert to an expression (a-b).

You could of course compose several of these techniques into one, but if
the class of expressions you expect is well-defined, it is probably
better to concentrate on one method.

      -s