testeq - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Logic : Boolean : testeq

testeq

random polynomial-time equivalence tester

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

testeq(a = b)

testeq(a, b)

testeq(a)

Parameters

a, b

-

algebraic expressions

Description

• 

The function testeq tests for equivalence probabilistically. It returns false if the expressions are not equal (or not equal to 0) and true otherwise for the class of expressions that testeq recognizes.  The result false is always correct; the result true may be incorrect with very low probability.

• 

This function will succeed over expressions formed with rational constants, independent variables, and I, combined by arithmetic operations, exponentials, trigonometrics and a few others. It may also succeed with some expressions involving algebraic constants and functions and involving Pi as an argument of trigonometrics. If the expressions do not fall in this class, testeq returns FAIL.  testeq may also return FAIL if it cannot find an appropriate modulus that works after seven trials.

Examples

asinx2cosxtanxsinx2+cosxtanx2:

b1sin2x241sin2xcosx22cosx2+1sin2xcosx32+3cosx4cosx6:

evalba=b

false

(1)

evalbexpanda=expandb

false

(2)

testeqa=b

true

(3)

References

  

Gonnet, Gaston. "Determining Equivalence of Expressions in Random Polynomial Time." Proceedings of the 16th ACM Symposium on the Theory of Computing. Washington DC. April 1984. pp. 334-341.

See Also

evalb

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam