Displaying 20 results from an estimated 1000 matches similar to: "Bug or inaccuracy in cumsum( )"
2009 Jul 23
2
Bug in seq() (PR#13849)
Full_Name: Jeremiah Cohen
Version: 2.9.0
OS: Windows XP
Submission from: (NULL) (129.59.230.235)
I believe there is a bug in the seq() function for certain values of the "from"
argument. Here are examples:
> seq(-.2, .1, .1)
[1] -0.2 -0.1 0.0 0.1
> seq(-.3, .1, .1)
[1] -3.000000e-01 -2.000000e-01 -1.000000e-01 5.551115e-17 1.000000e-01
> seq(-.4, .1, .1)
[1] -0.4 -0.3
2004 Sep 03
6
seq
Hi everyone,
I've tried the below on R 1.9.1 and the 2004-08-30 builds of R 1.9.1
Patched and R 2.0.0 on Windows 2000, and the results are consistent.
> seq(0.5, 0, by = -0.1)
[1] 0.5 0.4 0.3 0.2 0.1 0.0
> seq(0.7, 0, by = -0.1)
[1] 7.000000e-01 6.000000e-01 5.000000e-01 4.000000e-01 3.000000e-01
2.000000e-01 1.000000e-01 -1.110223e-16
Is this really the intended behaviour?
2007 Feb 25
1
Writing integers in "write.matrix" function
Hello everyone,
I am using the following program to get the p-value of some numbers
(column 'LR' of the data.dat file). I want to write the 1st and 2nd
column of the output file (data.out) as an integer while the program
change them. Could anybody please tell me how I can write
the code which writes the values of the first two columns as integer?
For your convenience, I have attached the
2008 Apr 24
2
problem with "which"
Hi,
I'm having trouble with the "which" or the "seq" function, I'm not sure.
Here's an example :
> lat=seq(1,2,by=0.1)
> lat
[1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
> which(lat==1)
[1] 1
> which(lat==1.1)
[1] 2
> which(lat==1.2)
[1] 3
> which(lat==1.3)
[1] 4
> which(lat==1.4)
[1] 5
> which(lat==1.5)
[1] 6
>
2002 Oct 29
1
pretty not pretty
Hi,
I have a following vector:
> smallch
[1] 0.0652840 0.1181300 0.0319370 0.0155700 0.0464110 0.0107850
[7] 0.0158970 0.0375900 0.0603090 0.0310300 0.0105920 0.0540580
[13] -0.0177740 0.0039393
Pretty (R 1.5.1) has problems with zero:
> pretty(smallch)
[1] -2.000000e-02 -3.469447e-18 2.000000e-02 4.000000e-02 6.000000e-02
[6] 8.000000e-02 1.000000e-01 1.200000e-01
2002 Oct 29
1
pretty not pretty
Hi,
I have a following vector:
> smallch
[1] 0.0652840 0.1181300 0.0319370 0.0155700 0.0464110 0.0107850
[7] 0.0158970 0.0375900 0.0603090 0.0310300 0.0105920 0.0540580
[13] -0.0177740 0.0039393
Pretty (R 1.5.1) has problems with zero:
> pretty(smallch)
[1] -2.000000e-02 -3.469447e-18 2.000000e-02 4.000000e-02 6.000000e-02
[6] 8.000000e-02 1.000000e-01 1.200000e-01
2001 Jul 25
1
bug in pretty() (PR#1032)
I have the following output from pretty():
> pretty(c(-.1, 1)) # note 2nd element
[1] -2.000000e-01 -2.775558e-17 2.000000e-01 4.000000e-01 6.000000e-01
[6] 8.000000e-01 1.000000e+00
> as.character(pretty(c(-.1, 1)))
[1] "-0.2" "-2.77555756156289e-17" "0.2"
[4] "0.4" "0.6"
2012 Jan 24
2
[LLVMdev] Pointer aliasing
Hi Roel,
the code you list below is precisely what I expect to get (of course
the stores must happen but the constant folding should happen as
well).
It all looks very strange. LLVM is behaving as if the __restrict__
keyword was not used at all. Even more strange is the fact that for
this function:
double f(double *__restrict__ x, double *__restrict__ y, double *__restrict__ z)
{
*x = 1.0;
2012 Jan 24
0
[LLVMdev] Pointer aliasing
Hi Brent,
I think this is a problem in the easy-cse transform. In this transform
load operations can be replaced by their subexpression, in this case the
propagated constant, based on the value of the 'CurrentGeneration' of
memory writes. This implies that any store operation invalidates the
knowledge about previously stored subexpressions.
In general, this is a safe assumption but
2012 Jan 24
0
[LLVMdev] Pointer aliasing
Hi Brent,
Looking at your code I can see at least one reason why some of the store
operations remain in the output since you are (through x, y, and z)
writing in memory which exists outside of your function (p).
Constant propagation also seems to work in the first few lines, *y = *x
+1 (%3) is stored directly.
The strange thing to me is that the same doesn't happen for *z = *x + 2.
Here
2012 Jan 24
0
[LLVMdev] Pointer aliasing
I have no clue, I didn't have time to look into that example yet.
How does the IR (before optimization) differ from the other version?
Roel
On 01/24/2012 04:45 PM, Brent Walker wrote:
> Can you explain please why it works for this version of the function:
>
> double f(double *__restrict__ x, double *__restrict__ y, double
> *__restrict__ z);
>
> What is different here?
2012 Jan 24
2
[LLVMdev] Pointer aliasing
I think the problem here is that the IR doesn't have any way to attach restrict information to loads/stores/pointers.
It works on arguments because they can be given the 'noalias' attribute, and then the alias analyzer must understand what that means.
Pete
On Jan 24, 2012, at 7:47 AM, Roel Jordans wrote:
> I have no clue, I didn't have time to look into that example yet.
2012 Jan 24
4
[LLVMdev] Pointer aliasing
Can you explain please why it works for this version of the function:
double f(double *__restrict__ x, double *__restrict__ y, double
*__restrict__ z);
What is different here? There are stores here as well.
Brent
On Wed, Jan 25, 2012 at 12:34 AM, Roel Jordans <r.jordans at tue.nl> wrote:
> Hi Brent,
>
> I think this is a problem in the easy-cse transform. In this transform
2012 Jan 24
0
[LLVMdev] Pointer aliasing
Peter Cooper wrote:
> I think the problem here is that the IR doesn't have any way to attach restrict information to loads/stores/pointers.
I think we do now, actually. Now that the loads and stores have TBAA
metadata, I think the restrict attribute can go there. It needs to be
attached to every use of a restrict pointer, but that's similar to how
TBAA already works.
> It works
2012 Jan 23
2
[LLVMdev] Pointer aliasing
Hi LLVMers,
I would like to ask a question regarding aliasing. Suppose I have the
following program:
double f(double** p )
{
double a,b,c;
double * x = &a;
double * y = &b;
double * z = &c;
*x = 1;
*y = *x + 2;
*z = *x + 3;
return *x+*y+*z;
}
LLVM can tell that the three pointers do not alias each other so can
perform the constant folding at compile time.
2002 Jun 14
0
pretty() sometimes isn't
Hi all,
R> seq(-.4, .8, length=7)
[1] -4.000000e-01 -2.000000e-01 5.551115e-17 2.000000e-01 4.000000e-01
[6] 6.000000e-01 8.000000e-01
Well that may not be a "bug", but it has this unfortunate consequence:
R> pretty(c(-.4,.8))
[1] -4.000000e-01 -2.000000e-01 5.551115e-17 2.000000e-01 4.000000e-01
[6] 6.000000e-01 8.000000e-01
And thus my plot axes look funny
2005 Oct 27
0
Column names in qr() and chol() (PR#8258)
I am using 2.2.0
If the QR decomposition of an N*M matrix is such that the pivoting order
is not 1:M, Q%*%R does not result in the original matrix but in a
matrix with the columns permuted. This is clearly intentional, and
probably to be expected if pivoting is used --- chol() behaves in the
same manner (it would perhaps be nice if the qr help page made that
clear in the same way that the chol()
2008 Aug 07
1
qgamma inaccuracy (PR#12324)
Full_Name:
Version: 2.7.1 (2008-06-23)
OS: windows vista
Submission from: (NULL) (216.82.144.137)
Hello,
I have been working with various probability distributions in R, and it seems
the gamma distribution is inaccurate for some inputs.
For example, qgamma(1e-100, 5e-101, lower.tail=FALSE) gives: 1.0. However, it
seems this is incorrect; I think the correct answer should be
2008 Aug 05
0
qgamma inaccuracy
Hello,
I have been working with various probability distributions in R, and it
seems the gamma distribution is inaccurate for some inputs.
For example, qgamma(1e-100, 5e-101, lower.tail=FALSE) gives: 1.0. However,
it seems this is incorrect; I think the correct answer should be
0.082372029620717283. When I check these numbers using pgamma, I get:
pgamma(1,5e-101, lower.tail=FALSE) =
2010 Aug 12
2
[LLVMdev] Instruction does not dominate all uses?
This has been driving me crazy. In order to JIT stuff in a simple REPL I'm
trying to wrap them in anonymous functions and then evaluate them (as per
recommendation of the Kaleidoscope guide).
With simple expressions it works fine. Like if I try and add 4 and 5, I get
this from the bare llvm::Value dump:
double 9.000000e+00
and this after it's wrapped in a function:
define double @0() {