Re: [Python-3000] adding gamma and error functions to math module

2008-07-24 Thread nirinA raseliarison
on Mon, 21 Jul 2008 08:46:03 -0500 "Daniel Stutzbach" wrote: > Also, the patch doesn't include the extensive comments in the original > code that explain the mathematics. Including a URL in the patch would > at least allow someone to find those comments. i rearranged the patches so that they are

Re: [Python-3000] adding gamma and error functions to math module

2008-07-21 Thread Daniel Stutzbach
On Mon, Jul 21, 2008 at 8:16 AM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > Terry Reedy >> I'm interested also. Done and done. >> http://bugs.python.org/issue3366 > patch is submitted. it is tested only on linux-2.6.26 > with gcc-4.3.1. Thanks for doing this. In the patch, wouldn't it be g

Re: [Python-3000] adding gamma and error functions to math module

2008-07-21 Thread nirinA raseliarison
Terry Reedy > I'm interested also. Done and done. > http://bugs.python.org/issue3366 patch is submitted. it is tested only on linux-2.6.26 with gcc-4.3.1. Raymond Hettinger > Discussions of "my approximation is better/faster/etc than yours" > can be interminable. > Recommend you put together your

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread Mark Dickinson
On Wed, Jul 16, 2008 at 5:03 PM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > my initial motivation is to make these functions accessible, > with just a few lines of additionnal code. that's so simple > with a linux box! As Daniel Stutzbach already hinted, the easiest way to just get at the sy

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread Daniel Stutzbach
On Wed, Jul 16, 2008 at 11:04 AM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > Daniel Stutzbach wrote: >> http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/newlib/libm/math/s_erf.c?rev=1.1.1.1&cvsroot=src > > a personnal view here. i'm always perplex when there > are many magic numbers in

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread Mark Dickinson
On Wed, Jul 16, 2008 at 5:03 PM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > with the gamma from gcc under linux, > which uses the MPFR library, Are you sure it uses MPFR? I thought that for gcc 4.3, MPFR was used only for compile-time constant expressions. For a call to tgamma whose argume

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread nirinA raseliarison
on Tue, 15 Jul 2008 08:32:02 -0500 Daniel Stutzbach wrote: > I suggest using the versions from newlib's libm. They contain > extensive comments explaining the math and have a generous license, > e.g.,: > > http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/newlib/libm/math/s_erf.c?rev=1.1.1.

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread Raymond Hettinger
From: "nirinA raseliarison" <[EMAIL PROTECTED]> >>> from test.test_random import gamma . . . there is a simple implementation in Python at: http://en.wikipedia.org/wiki/Lanczos_approximation with coefficients slightly different from those in test_random.py, one gets: . . . with the gamma from

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread nirinA raseliarison
on Tue, 15 Jul 2008 09:27:39 +0100 Mark Dickinson wrote: > Writing explicit code for these functions, for platforms > whose libm doesn't support them, would be a fairly major task. > Stealing code (in an appropriately legal fashion) from somewhere > else might work. > In any case, if you're inter

Re: [Python-3000] adding gamma and error functions to math module

2008-07-16 Thread nirinA raseliarison
on Tue, 15 Jul 2008 01:39:19 -0700 Raymond Hettinger wrote: > In the meantime, here's a little cheat: > > >>> from test.test_random import gamma > >>> gamma(4) > 5.9982 > >>> gamma(5) > 24.0 > >>> gamma(6) > 120.03 > >>> gamma(6.1) > 142.45194406567856 there is a simple im

Re: [Python-3000] adding gamma and error functions to math module

2008-07-15 Thread Terry Reedy
Mark Dickinson wrote: In any case, if you're interested in getting these in to 2.7/3.1 (it's too late for 2.6/3.0) then I'd suggest opening a feature request at bugs.python.org. (And assign it to me, if you like.) I'm interested also. Done and done. http://bugs.python.org/issue3366 __

Re: [Python-3000] adding gamma and error functions to math module

2008-07-15 Thread Daniel Stutzbach
On Tue, Jul 15, 2008 at 3:27 AM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > One reason is that they're probably not available on all platforms; > these functions > are part of the C99 standard, and not everyone has caught up with all the > little > details of C99 yet. In particular, I wouldn't b

Re: [Python-3000] adding gamma and error functions to math module

2008-07-15 Thread Raymond Hettinger
- Original Message - From: "Mark Dickinson" <[EMAIL PROTECTED]> To: "nirinA raseliarison" <[EMAIL PROTECTED]>; "python-3000" Sent: Tuesday, July 15, 2008 1:27 AM Subject: Re: [Python-3000] adding gamma and error functions to math module

Re: [Python-3000] adding gamma and error functions to math module

2008-07-15 Thread Mark Dickinson
On Tue, Jul 15, 2008 at 9:10 AM, nirinA raseliarison <[EMAIL PROTECTED]> wrote: > gammas and errors functions are available from the C standard > library. it would be nice to have them in the math module. > or is there any reason not to include them? One reason is that they're probably not availab

[Python-3000] adding gamma and error functions to math module

2008-07-15 Thread nirinA raseliarison
gammas and errors functions are available from the C standard library. it would be nice to have them in the math module. or is there any reason not to include them? diff -u1 /usr/local/src/Python-3.0b1/Modules/mathmodule.c mathmodule.c --- /usr/local/src/Python-3.0b1/Modules/mathmodule.c2008-