From: SourceForge.net <no...@so...> - 2008-07-17 13:51:34
|
Bugs item #2013650, was opened at 2008-07-08 13:01 Message generated for change (Comment added) made by macrakis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2013650&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Floating point Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: gamma(250.0) returns non-number; gamma(-1.0) finite Initial Comment: gamma(250.0) and 250.0! return non-numbers. This causes an error in printing ("Can't print a non-number"). It should cause a clean overflow error. The problem is in gamma-lanczos, which doesn't check that its return value is well-defined (not infinite, not a NaN) before returning it. gamma-lanczos also does not report an error for negative integer arguments: gamma(-1.0) => -2.6e+16 Worse, bfloat(gamma(250.0)) returns a grossly incorrect result -- see next error report. Tested on Maxima 5.14.0 GCL Windows ---------------------------------------------------------------------- >Comment By: Stavros Macrakis (macrakis) Date: 2008-07-17 09:51 Message: Logged In: YES user_id=588346 Originator: YES As long as we don't have a well-defined policy for Maxima's handling of IEEE infs and NaNs, it is a bug for any routine to return an IEEE inf or NaN. When/if we define the behavior and update the code to work correctly in the presence of inf/NaN, then it will be fine. ---------------------------------------------------------------------- Comment By: Robert Dodier (robert_dodier) Date: 2008-07-11 23:41 Message: Logged In: YES user_id=501686 Originator: NO I 'm not convinced the problem is in GAMMA-LANCZOS. If the Lisp implementation permits infinity and NaN as floating point results, then Maxima functions could just pass those along. The only bug that I see here for sure is that GCL cannot display NaN and infinity (although such values can be computed by GCL). For the sake of uniform behavior, I suppose Maxima functions could reject NaN and infinity, no matter which Lisp, or allow them. Probably it is easier to reject NaN and infinity. I'm undecided at this point about having a uniform policy wrt floating point special values, or letting it remain an implementation-dependent feature. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2013650&group_id=4933 |