type/evenfunc - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/evenfunc

type/evenfunc

check for an even function

type/oddfunc

check for an odd function

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(f, evenfunc(x))

type(f, oddfunc(x))

Parameters

f

-

expression, regarded as a function of x

x

-

name

Description

• 

These procedures test the parity of the expression f, that is, whether it is even or odd, with respect to x.

• 

More precisely, typefx,evenfuncx returns true if Maple can determine that fxfx is zero and false otherwise.  Maple performs this test by calling Testzero on this difference. If false is returned, that is not a guarantee that f is not even: it may be zero, but if so, Testzero is not strong enough to recognize that the result is zero. Type oddfuncx is determined in a similar way but using the expression fx+fx.

Examples

typex2,evenfuncx

true

(1)

typex2y3+2,evenfuncx

true

(2)

typesinx,oddfuncx

true

(3)

typex2x1,oddfuncx

false

(4)

In the following case, f is even, but the default zero testing algorithm does not recognize this.

fpiecewisex=0,1,1x2

f1x=01x2otherwise

(5)

typef,evenfuncx

false

(6)

By changing the zero testing algorithm, we can make this return true. By default, Testzero calls Normalizer. In this case, we strengthen Normalizer.

Normalizersimplify

Normalizersimplify

(7)

typef,evenfuncx

true

(8)

See Also

type