[issue3366] Add gamma function, error functions and other C99 math.h functions to math module

Mark Dickinson report at bugs.python.org
Sun Dec 13 13:53:48 CET 2009

Mark Dickinson <dickinsm at gmail.com> added the comment:

nirinA: thanks for the erf patch.  It's fine as far as it goes;  the main 
technical issue is that the series development only converges at a 
sensible rate for smallish x;  for larger x something more is needed.

Here's a prototype patch for the erf and erfc functions that uses a power 
series (not quite the same as the series nirinA used;  by pulling out a 
factor of exp(-x*2) you can make all coefficients in the remaining series 
positive, which is good for the numerics) for small x, and a continued 
fraction expansion for larger x.   The erf and erfc functions are 
currently written in Python.  I'll do some more testing (and possibly 
tweaking) of this patch and then translate the Python to C.

Added file: http://bugs.python.org/file15539/erf.patch

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list