[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: incorrect test on gamma function ?
From: |
Tatsuro MATSUOKA |
Subject: |
Re: incorrect test on gamma function ? |
Date: |
Thu, 28 Oct 2010 08:00:40 +0900 (JST) |
Hello
On cygwin, are gamma and lgamma on the GCC used or slatec gamma used?
On MinGW, slatec gamma is used and I have sent a patch for slatec gamma
function.
bug #30824: gammaln(0) and gammaln((minus integer)) give slatec error
http://savannah.gnu.org/bugs/?func=detailitem&item_id=30824
If this modification is incorrect, please give consider the patch.
Regards
Tatsuro
--- Marco Atzeri wrote:
> Hi,
> could someone explain me why
> we expect:
>
> gamma(0) = Inf
> gamma(-1) = NaN
>
> >>>>> processing /pub/hg/octave/src/mappers.cc
> ***** test
> x = [-1, 0, 1, Inf];
> v = [NaN, Inf, 1, Inf];
> assert (gamma(x), v);
> assert (gamma(single (x)), single (v));
> !!!!! test failed
> assert (gamma (x),v) expected
> NaN Inf 1 Inf
> but got
> Inf Inf 1 Inf
> NaNs don't match
>
> considering the graphics
> http://en.wikipedia.org/wiki/Gamma_function
>
> I presume the two values should be both Inf (or both NaN)
>
> Marco
>
>
>
>
>
>
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/