From mwelinder at gmail.com  Wed Jun  1 16:16:17 2005
From: mwelinder at gmail.com (Morten Welinder)
Date: Wed Jun  1 16:16:25 2005
Subject: [Rd] Re: 1/tan(-0) != 1/tan(0)
In-Reply-To: <17053.28658.832404.930124@stat.math.ethz.ch>
References: <20050601065718.37105A1C3@slim.kubism.ku.dk>
	<17053.28658.832404.930124@stat.math.ethz.ch>
Message-ID: <118833cc050601071618434dcd@mail.gmail.com>

> For the real problem, the R source (in C), It's simple
> to work around the fact that
>     qcauchy(0, log=TRUE)
> for Morten's code proposal gives -Inf instead of +Inf.

Ouch.  Good catch.

Here is what happened: I reduced 1-exp(x) to -expm1(x) which is actual wrong for
x=0 because the results will be differently signed zeros.

I should have reduced 1-exp(x) to 0-expm1(x).

In light of this, any use of R_DT_qIv and R_DT_CIv might have the same problem.
(But, quite frankly, all uses of R_DT_qIv should be eliminated anyway.
 Only qnorm
seems to be using it without killing the right-tail and the log cases.)

Morten


[Rd] Re: 1/tan(-0) != 1/tan(0)
Morten Welinder