From: Eddie R. <er...@bm...> - 2008-09-08 23:07:57
|
On Tue, 2008-09-09 at 00:31 +0200, Albert Graef wrote: > 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.) In Pure, ln 0 => -inf and ln 0.0 -> -inf. The former is an exact zero so in real math ln 0 should be undefined. The second is a number close to zero which yields -inf. So I'm thinking the exact 0 for the imaginary part of 0.0 should also be promoted to double just like in ln 0. If I'm wrong then I'm Ok with that. > - 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). Hm. if we start worrying about 0.0+:0 vs 0.0+:0.0, then should we also worry about ln 0 vs ln 0.0 too? I think I've already mentioned that mzscheme says that (log 0) is undefined and (log 0.0) => -inf.0. Am I'm flogging a dead horse here? Oh woe woe woe is me! e.r. |