erf(x)+erfc(x)=1 precision problem
Wed Jun 4 06:33:00 GMT 2008
On Sun, Jun 1, 2008 at 11:19 AM, Reini Urban <firstname.lastname@example.org> 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 , 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.
More information about the Newlib