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

From: Morten Welinder <mwelinder_at_gmail.com>
Date: Wed 01 Jun 2005 - 14:16:17 GMT

> 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.)


R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Jun 02 00:21:19 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:26:57 GMT