Re: closed form of modulus function

From: Mitch Harris (harrisq_at_tcs.inf.tu-dresden.de)
Date: 02/11/05


Date: Fri, 11 Feb 2005 09:58:09 +0100

Alex Hunsley wrote:
> The modulus function, which gives the 'magnitude' of a number (in effect
> removes a negative sign if one exists), can be expressed in closed form
> as either sqrt(x^2) or (sqrt(x))^2. Is either of these forms preferable?
> In practical terms, I think the former is the best, as it doesn't
> involve the possibility of imaginary numbers coming up during the
> calculation, which could cause an algorithm/computer program to object....

"closed form" is a slippery concept. It really just means "in a form
of my choosing" (for whoever utters it). Depending on your purposes,
you may just want to stick with "|x|" and manipulate that directly
rather than deal with the branches of the inverse of x^2.

-- 
Mitch Harris
(remove q to reply)


Relevant Pages

  • Re: closed form of modulus function
    ... Alex Hunsley wrote: ... > removes a negative sign if one exists), can be expressed in closed form ... > In practical terms, I think the former is the best, as it doesn't ... oops, sorry, obviously had a brain fart, as sqrtcould give you +/- ...
    (sci.math)
  • Re: closed form of modulus function
    ... > Alex Hunsley wrote: ... >> removes a negative sign if one exists), can be expressed in closed form ... >> In practical terms, I think the former is the best, as it doesn't ... Cheers Hanford ...
    (sci.math)