Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,120 of 10,432    |
|    clicliclic@freenet.de to Richard Fateman    |
|    Re: How should software compare complex     |
|    25 Jul 16 16:24:08    |
      Richard Fateman schrieb:       >       > On 7/24/2016 3:48 PM, Nasser M. Abbasi wrote:       > > I tried this on Maple, Mathematica, MuPad (part of Matlab) and       > > Matlab.       > >       > > Asked for maximum of I and 1.0, where I=sqrt(-1).       > >       >       > [...]       >       > So what to do. A symbolic system could do one of a number of       > things.       > 1. Something more or less bogus like Matlab.       > 2. Give an error message       > and stop computing (perhaps wait for a user to supply an answer?       > perhaps berate the user in some way by appealing to the Algebra       > course he/she never took?)       > 3. Leave the expression unevaluated as max(W,V).       > (hoping that it might perhaps be multiplied by zero and not matter???)       > 4. Exercise some judgment of the form "the imaginary part is down       > in the roundoff, let's keep computing." One way to handle this       > is to drop it, make a note of the occurrence and alert the user at the       > end of the computation that a certain number of such transformations       > were done. E.g. plotting a mathematically real function f(x) which       > numerically turns out to have some tiny imaginary parts.       > 5. Make it possible to do any of the choices above, or maybe       > some others?       >       > Maxima does 3 by default, but could be instructed to do any of       > the other choices by modifying the simplification of max().       >       > Mathematica gives a warning message, but then does 3. You       > can redefine Max in Mathematica if you first Unprotect it.       >              Derive 6.10 also just leaves MAX(#i, 1) untouched under exact as well as       approximate (e.g. ten decimal digit) evaluation. No error message is       generated. And because all Derive numbers are exact rationals, MAX(0.0 +       1.0*#i, 1.0 + 0.0*#i) means exactly the same as MAX(#i, 1).              Jeff's example suggests that the limit LIM(MAX(-2 + eps*#i, 1), eps, 0)       differs from MAX(-2, 1) in MATLAB. So if Matlab's extension of MAX works       properly for real arguments, it will be discontinuous for complex ones.       It would have to return MAX(-ABS(-2 + eps*#i), 1) to be continuous here.       Maybe Matlab's function arguments are typed and we are dealing with       separate functions here: MAX(real, real) and MAX(complex, complex). In       such a world, -2 + eps*#i tending to -2 would remain complex and could       never become real ...              In mathematics, and therefore in Computer Algebra, however, the real       numbers are a subset of the complex numbers and MAX(ABS(x), ABS(y)) =       MAX(x, y) is mathematically wrong for certain real arguments. If someone       is here interested in MAX(ABS(x), ABS(y)) for real or complex arguments,       he would be required to write just this. For repeated use he could       define his own function MAXABS(x,y) := MAX(ABS(x), ABS(y)) and then       write simply MAXABS(x,y).              A mathematically sensible extension to the complex numbers could be       component-wise application: MAX(u, v) := MAX(RE(u), RE(v)) +       #i*MAX(IM(u), IM(v)). I suppose some systems provide a component-wise       FLOOR and ROUND already. A component-wise ABS(z) := ABS(RE(z)) +       #i*ABS(IM(z)) that is compatible with such a component-wise MAX would       collide with the standard mathematical notion of the absolute value of       complex numbers, however, so a different name would be needed ...              Martin.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca