Function: math[cancel] - deletes real and complex numbers very close to zero from an expression

Calling Sequence:

cancel(expr);

cancel(expr, 'eps'=val);

Parameters:

expr - an algebraic expression

eps - the name 'eps'

val - a numeric value

Description:

The function searches an expression for real floats or complex floats. If the absolute value of the respective float is less than a given threshold, then this float is replaced with 0 in the expression. By default, the threshold is determined by the global math variable _MathEps which be default is set .1*10^(-7).

If a complex float is found in expr, cancel is applied to its real and imaginary part.

If you wish to choose another value for the threshold, pass the option 'eps' = <val>, where <val> is a numeric value (prefferably close to zero) or change the value of _MathEps .

This function is part of the math package, and so can be used only after performing the command with(math) or with(math, cancel).

Examples:

> with(math):

> p := x^4-12*x^3+25*x+116;

[Maple Math]

> fsolve(p, x, complex);

[Maple Math]

> newp := makepoly({%}, x);

[Maple Math]

> cancel(newp, eps=1e-5);

[Maple Math]

> roundf(%);

[Maple Math]

See Also:

math/cutzeros , math/roundf , math/slice .

Version History:

Version 1.0 - current as of February 26, 1998

Version 1.1 - current as of June 06, 1998

Version 1.1.1 - current as of April 16, 2000