fnormal in maple (version 7, anyway)



Given the definition below, a simplified version of Maple's fnormal would
be:

fnormal(ex):=
   if numberp(ex) and abs(ex) < 1.0e-14 then 0
   elseif mapatom(ex) then ex
   else map(fnormal,ex);

By the way, not only is the name of this function peculiar, but the
functionality seems a bit strange (given that rational arithmetic is exact
and bfloat arithmetic has adjustable precision).  But if it's useful to
you....

           -s


On Mon, Sep 1, 2008 at 12:31 PM, Richard Fateman <fateman at cs.berkeley.edu>wrote:

> I think this is particularly poorly named, but here is what I get from the
> "help" system in Maple version 7...
>
>
> Calling Sequence
>     fnormal(e)
>     fnormal(e, digits)
>     fnormal(e, digits, epsilon)
> Parameters
>     e       - an algebraic expression, or a list, set, relation, series, or
> range of algebraic expressions
>     digits  - (optional) number of digits for floating-point evaluation
> (defaults to the value of the global variable Digits)
>     epsilon - (optional) error tolerance for ``fuzzy zero'' (defaults to
> the value Float(1,-digits+2))
> Description
> The value returned by fnormal is an expression equivalent to e under the
> assumption that all numeric values with magnitude less than epsilon may be
> considered to be zero.
> In addition, all floats in e which remain nonzero are converted to floats
> with digits precision.
> fnormal preserves numeric type and sign information as much as possible.
> Thus, for example, fnormal(1e-20*I, 10) = 0.*I not 0. . This ensures that
> branching behaviour is generally not affected by fnormal. Use
> simplify(expr,
> zero) to remove 0 real or imaginary parts of complex floating point
> numbers.
>
> If e is a list, set, range, series, equation, or relation, then fnormal is
> applied recursively to the components of e.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>