This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: erf(x)+erfc(x)=1 precision problem


On Sun, Jun 1, 2008 at 11:19 AM, Reini Urban <rurban@x-ray.at> wrote:
> While testing the new clisp-cvs on cygwin I came to the following
> erf/erfc precision problems with the double definitions.
>
> There are some minor deviations from the glibc2 (linux) results, but a
> bigger problem is that erf(-1) + erfc(-1) is unequal to (double) 1.0.
> The error is 1.1102230246251565e-16
> This looks like just one digit, but it is the only significant digit
> deviation in the erf(x) + erfc(x)
> test  between [-10, 10].
> erfc(27) leads to floating point underflow too, but this is probably acceptable.
>
> Sorry, I'm not qualified at all to offer a patch, just the link to sun's
> free erf/erfc implementation [1], which lcc also uses.
>
> Results in detail:
> CORRECT is glibc, CLISP is cygwin newlib gcc-3.4.4 on a i686 with HW FPU.

As it turns out the deviations are a 64-bit issue, and not related to
a glibc <-> newlib difference.
I use 32 bit XP / cygwin with no 64bit gcc options.

The same issues as on i386-cygwin appear on i386-linux (glibc).
So the 2 problems erfc(-1) and erc(27) have to be fixed for 32bit CPU's.
-- 
Reini Urban
http://phpwiki.org/ http://murbreak.at/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]