#424 IS often doesn't work

closed
nobody
Tests (20)
5
2003-10-17
2003-10-13
Jonas Diemer
No

Hi!

The IS function is used to evaluate if an expression is
true, correct? It doesn't seem to like equations that
are not factored out:

2*(x-(y+x))=2*x-2*(y+x);

should be true, right? IS sais, it wasn't.

Jonas

PS: I am not an expert in CAS. If I reported complete
bullshit, I would be happy about a short explanation
why. thanks in advance.

Discussion

    • status: open --> closed
     
  • Logged In: YES
    user_id=588346

    In Maxima, is(...=...) tests for *syntactic* equality: the two
    expressions have the same structure. To test for *semantic*
    equality, use equal.

    In your example, is(equal(2*(x-(y+x)),2*x-2*(y+x)) returns
    true as you'd expect.

    That said, in many cases is/equal cannot determine the
    correct result, even if other parts of Maxima can -- e.g. is
    (equal(sin(x)^2+cos(x)^2,1)).

    I agree that this is confusing, but this is the intended
    behavior.

     
  • Jonas Diemer
    Jonas Diemer
    2003-10-17

    Logged In: YES
    user_id=154672

    I see. Maybe somthing about testing equality etc. could go
    in the Primer or somewhere else...

    Regards