From terra at gnome.org  Sun Apr 11 19:04:01 2004
From: terra at gnome.org (terra@gnome.org)
Date: Sun Apr 11 19:04:05 2004
Subject: [Rd] pcauchy precision (PR#6756)
Message-ID: <20040411170401.3E7FBEDF1@slim.kubism.ku.dk>

Full_Name: Morten Welinder
Version: snapshot
OS: 
Submission from: (NULL) (65.213.85.129)


Two things are wrong.

1. There is nan test outside IEEE_754.
2. The meat part of the function should really be something like...

    if (!lower_tail)
	    x = -x;

    if (fabs (x) > 1) {
	    double temp = atan (1 / x) / M_PI;
	    return (x > 0) ? R_D_Clog (temp) : R_D_val (-temp);
    } else
	    return R_D_val (0.5 + atan (x) / M_PI);

...instead of the current heavily truncated series expansion.  The above is
much
simpler and more precise.  (Thanks to Ian Smith for pointing the in-hindsight-
obvious 1/x trick out.)


[Rd] pcauchy precision (PR#6756)
terra@gnome.org