From maechler at stat.math.ethz.ch  Wed Mar 24 08:36:14 2004
From: maechler at stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed Mar 24 08:36:16 2004
Subject: [Rd] pgeom accuracy (PR#6687)
Message-ID: <20040324073614.ABE8E1043D@slim.kubism.ku.dk>

>>>>> "Morten" == Morten Welinder <terra@gnome.org>
>>>>>     on Tue, 23 Mar 2004 19:10:07 +0100 (CET) writes:

    Morten> Full_Name: M. Welinder Version: 1.6.2 and 1.8.1 OS:
    Morten> Solaris Submission from: (NULL) (65.213.85.223)


    Morten> The common lower_tail==TRUE && log_p==FALSE case can
    Morten> be improved as

    Morten>   if (lower_tail && !log_p) return -expm1 ((x + 1) *
    Morten> log1p (-p));

    Morten> This improves precision when p is very small and x
    Morten> not too big by avoiding two problematic "1-sth"
    Morten> calculations.

That's entirely correct,
Thank you, Morten!

Improvement committed for R 1.9.0 beta.
Martin


[Rd] pgeom accuracy (PR#6687)
maechler@stat.math.ethz.ch