This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mark.dickinson
收信人 mark.dickinson, nirinA, rhettinger, stutzbach, terry.reedy
日期 2009-09-18.20:43:48
SpamBayes Score 3.9516435e-10
Marked as misclassified
Message-id <1253306634.98.0.629889201139.issue3366@psf.upfronthosting.co.za>
In-reply-to
内容
Here's a more careful patch for just the gamma function.  It's a fairly 
direct implementation of Lanczos' formula, with the choice of parameters 
(N=13, g=6.024680040776729583740234375) taken from the Boost library.  In 
testing of random values and known difficult values, it's consistently 
giving errors of < 5ulps across its domain.  This is considerably better 
than the error from the exp(lgamma(x)) method, since the exp call alone 
can easily introduce errors of hundreds of ulps for larger values of x.

I'd appreciate any feedback, especially if anyone has the chance to test 
on Windows:  I'd like to know whether I got the build modifications right.

This patch *doesn't* use the system gamma function, even when available.  
At least on OS X 10.5.8, the supplied gamma function has pretty terrible 
accuracy, and some severe numerical problems near negative integers.  I 
don't imagine Linux is much better.

Once this is working, I'll concentrate on lgamma.  Then erf and erfc.
历史
日期 用户 动作 参数
2009-09-18 20:43:55mark.dickinson修改recipients: + mark.dickinson, rhettinger, terry.reedy, stutzbach, nirinA
2009-09-18 20:43:54mark.dickinson修改messageid: <1253306634.98.0.629889201139.issue3366@psf.upfronthosting.co.za>
2009-09-18 20:43:53mark.dickinson链接issue3366 messages
2009-09-18 20:43:53mark.dickinson创建