[Python-3000] adding gamma and error functions to math module
Daniel Stutzbach
daniel at stutzbachenterprises.com
Wed Jul 16 19:08:17 CEST 2008
On Wed, Jul 16, 2008 at 11:04 AM, nirinA raseliarison
<nirina at mail.blueline.mg> 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 some code. unless i know how
> to compute these numbers.
The comments in the code *do* explain how to compute the numbers,
albeit tersely.
Most of the numbers are coefficients in a Taylor series expansion.
The code is a few hundred lines because numeric methods for these
functions that are accurate in the range [a,b] tend not to be accurate
outside the range [a,b]. Ergo, robust implementations include several
different methods so that they are accurate over the entire range of
the function.
--
Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC
More information about the Python-3000
mailing list