Re: [pure-lang-users] complex 0
Status: Beta
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2008-09-08 22:29:45
|
Eddie Rucker wrote: > > (2.0+:1.0)/0.0; > inf+:inf > > (2.0+:1.0)/(0.0+:0.0); > nan+:nan > > Um. Should this be consistent? Maybe, not sure. AFAICS, there are three possible perspectives: - (2.0+:1.0)/0.0 has an exact 0 in the imaginary part of the divisior, so it's actually a vector multiplied with an infinite scalar, whereas in the case of (2.0+:1.0)/(0.0+:0.0) it's an inexact zero so the general formula must be used which yields nan+:nan because a zero meets a pole in both components. (OTOH, if we take this view then probably (2.0+:1.0)/(0.0+:0) should yield the same result as the former, whereas right now it yields the same result as the latter.) - The divisor should be promoted to a complex 0.0+:0.0 in the first case, so you get nan+:nan in either case. - The divisior should be promoted to a real 0.0 in the second case, yielding inf+:inf in either case. That's what I get with mzscheme, but it doesn't make any real sense (pun intended) to me because 0.0+:0.0 is *not* the same as 0.0+:0 (or just 0.0) in the IEEE 754 sense (the imaginary zero might as well be just an underflow). I haven't checked the Goldberg paper, though. Maybe there's a "more defined" formula in the complex divisor case? Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |