similar to: Different results for tan(pi/2) and tanpi(1/2)

Displaying 20 results from an estimated 900 matches similar to: "Different results for tan(pi/2) and tanpi(1/2)"

2016 Sep 09
3
Different results for tan(pi/2) and tanpi(1/2)
The same argument would hold for tan(pi/2). I don't say the result 'NaN' is wrong, but I thought, tan(pi*x) and tanpi(x) should give the same result. Hans Werner On Fri, Sep 9, 2016 at 8:44 PM, William Dunlap <wdunlap at tibco.com> wrote: > It should be the case that tan(pi*x) != tanpi(x) in many cases - that is why > it was added. The limits from below and below of the
2016 Dec 01
1
Different results for cos,sin,tan and cospi,sinpi,tanpi
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-8 LC_COLLATE=ja_JP.UTF-8 [5] LC_MONETARY=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8 [7] LC_PAPER=ja_JP.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
2016 Sep 09
0
Different results for tan(pi/2) and tanpi(1/2)
If pi were stored and computed to infinite precision then yes we would expect tan(pi/2) to be NaN, but computers in general and R specifically don't store to infinite precision (some packages allow arbitrary (but still finite) precision) and irrational numbers cannot be stored exactly. So you take the value of the built in variable pi, which is close to the theoretical value, but not exactly
2016 Dec 01
2
Different results for cos,sin,tan and cospi,sinpi,tanpi
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 R-3.3.2.orig/src/nmath/cospi.c R-3.3.2/src/nmath/cospi.c --- R-3.3.2.orig/src/nmath/cospi.c 2016-09-15
2016 Dec 01
2
Different results for cos,sin,tan and cospi,sinpi,tanpi
>>>>> Martin Maechler <maechler at stat.math.ethz.ch> >>>>> on Thu, 1 Dec 2016 09:36:10 +0100 writes: >>>>> Ei-ji Nakama <nakama at ki.rim.or.jp> >>>>> 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)
2017 Feb 17
1
Wish List: Extensions to the derivatives table
The issue is that without an extensible derivative table or the proposed extensions, it is not possible to automatically produce (without manual modification of the deriv3 output) a function that avoids catastrophic cancellation regardless of the working range. Manual modification is not onerous as a one-time exercise, but can be time consuming when it must be done numerous times, for example
2017 Feb 17
4
Wish List: Extensions to the derivatives table
The derivative table resides in the function D. In S+ that table is extensible because it is written in the S language. R is faster but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p,
2016 Dec 01
0
Different results for cos,sin,tan and cospi,sinpi,tanpi
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. On 01/12/2016 09:12, Martin Maechler wrote: >>>>>> Martin Maechler <maechler
2017 Feb 17
0
Wish List: Extensions to the derivatives table
Hi. Unless I'm misremembering, log, exp, sin, cos, and tan are all handled in deriv3. The functions listed are specially coded slightly more accurate versions but can be substituted with native ones for which deriv/deriv3 will work automatically. I believe that if you write your functions using log(a + 1) instead of log1p(a) or log(x) / log(2) instead of log2(x) deriv3 will work fine.
2009 May 14
2
How to do a pretty panel plot?
The pretty picture that I saw at: http://chartsgraphs.wordpress.com/2009/02/09/r-panel-chart-beats-excel-chart/#more-1096 inspired me to try something similar. The code that I wrote is: ------snipsnip--------------------------------------------------------------------- M <- structure(list(date = structure(c(13634, 13665, 13695, 13726, 13757, 13787, 13818, 13848, 13879, 13910, 13939, 13970,
2008 Apr 01
2
Applying rbind() to a sequence of data frame names
I have a set of data frames ds1, ds2, ... each having the same columns and column names: ds1 <- data.frame(x=c(1,2,3,4), y=c(5,6,7,8)) ds1 <- data.frame(x=c(9,10,11,12), y=c(13,14,15,16)) ... and I would like to combine them into just one data frame like ds <- rbind(ds1, ds2, ...) Because there are so many of them, I will have to use a character array nms <-
2008 Nov 28
7
Examples of advanced data visualization
Dear R-help, I am looking for ideas and presentations of new and advanced data visualization methods. As an example of what I am searching for, the 'Many Eyes' pages at http://manyeyes.alphaworks.ibm.com/manyeyes/ may provide a good paradigm. I would be interested even if it will not be easy to implement such examples in R, e.g. because of the interactive nature of these graphical
2009 Jul 07
3
r-project.org address blacklisted by anti-spam software
Dear List: An e-mail mentioning the r-project.org address and sent to a friend at a German university was considered spam by the local spam filter. Its reasoning: the URL "r-project.org" is blacklisted at uribl.swinog.ch resp. at antispam.imp.ch. I checked the list http://antispam.imp.ch/swinog-uri-rbl.txt [caution: long list] and indeed, there it was. Can anybody explain how or
2008 Sep 19
3
How to do knn regression?
Hello, I want to do regression or missing value imputation by knn. I searched r-help mailing list. This question was asked in 2005. ksmooth and loess were recommended. But my case is different. I have many predictors (p>20) and I really want try knn with a given k. ksmooth and loess use band width to define neighborhood size. This contrasts to knn's variable band width via fixing a
2010 Mar 21
2
Find a rectangle of maximal area
For an application in image processing -- using R for statistical purposes -- I need to solve the following task: Given n (e.g. n = 100 or 200) points in the unit square, more or less randomly distributed. Find a rectangle of maximal area within the square that does not contain any of these points in its interior. If a, b are height and width of the rectangel, other constraints may have to be
2008 Aug 19
1
nonlinear constrained optimization
Hi. I need some advises on how to use R to find pi (i is the index) with the following objective function and constraint: max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] s.t. (sum i)[ f(ai, bi, pi) * Di * pi] / (sum i)[ f(ai, bi, pi) * Di ] <= constant f and g are diffentiable. So, I am thinking of optim with method = "BFGS"? But wonder how to include the
2014 Apr 27
1
Strange behaviour of the ':' operator
Is the following really intended behaviour of the ':' operator, > s <- pi - 3.0 + 1e-07 > x <- s:pi > x [1] 0.1415928 1.1415928 2.1415928 3.1415928 though the last entry in the range vector is greater than pi? > x[4] > pi; x[4] - pi [1] TRUE [1] 1e-07 and the same, of course, for the seq() function. I would understand this behaviour for
2008 Mar 27
1
R Code and the Pygments Python SyntaxHighlighter
Dear R Help, is someone going to write a R/S language lexer for the Pygments Python syntax highlighter <http://pygments.org/>? As it is used now by Trac, Django, or the Python documentation tool Sphinx, the R community can apply it in Python-based Wikis like Moinmoin and others. Hans Werner
2007 Nov 13
1
Discrimination of almost-random time series
Dear time-series specialist: I've got some time series representing measurements from a physical process, like atomic decay data. These time series look almost random, but should hopefully be distinguishable as they were taken under different conditions. I am looking for statistical approaches that are sensitive enough to discriminate between such series of measurements. Preferably, there
2009 Feb 17
3
Subset Regression Package
Dear all , Is there any subset regression (subset selection regression) package in R other than "leaps"? Thanks and regards Alex [[alternative HTML version deleted]]