Re: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-12-05 Thread Ei-ji Nakama
hello, i read this pdf (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1950.pdf) i think ... x to be integer only(more accurate value). following test code and patch. ### F.10.1.12 The cospi functions ## cospi(+-0) : 1, 1 cospi(c(+0,-0)) ## cospi(n + 1/2)

Re: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-12-01 Thread Ei-ji Nakama
hi, my environment... > sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 8 (jessie) locale: [1] LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC=C [3] LC_TIME=ja_JP.UTF-8LC_COLLATE=ja_JP.UTF-8 [5] LC_MONETARY=ja_JP.UTF-8

Re: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-12-01 Thread Prof Brian Ripley
Please note that you need to report your platforms (as per the posting guide), as the C function starts #ifdef HAVE_COSPI #elif defined HAVE___COSPI double cospi(double x) { return __cospi(x); } And AFAICS the system versions on Solaris and OS X behave the same way as R's substitute.

Re: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-12-01 Thread Martin Maechler
> Martin Maechler > on Thu, 1 Dec 2016 09:36:10 +0100 writes: > Ei-ji Nakama > on Thu, 1 Dec 2016 14:39:55 +0900 writes: >> Hi, >> i try sin, cos, and tan. >>>

Re: [Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-12-01 Thread Martin Maechler
> Ei-ji Nakama > on Thu, 1 Dec 2016 14:39:55 +0900 writes: > Hi, > i try sin, cos, and tan. >> sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi) > [1] 0.5444181 0.8388140 1.5407532 > However, *pi results the following >>

[Rd] Different results for cos,sin,tan and cospi,sinpi,tanpi

2016-11-30 Thread Ei-ji Nakama
Hi, i try sin, cos, and tan. > sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi) [1] 0.5444181 0.8388140 1.5407532 However, *pi results the following > sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45) [1] 1 0 0 Please try whether the following becomes all right. diff -ruN