From Bert.DeBoeck at Ugent.be  Thu Mar  8 15:56:35 2007
From: Bert.DeBoeck at Ugent.be (Bert.DeBoeck at Ugent.be)
Date: Thu,  8 Mar 2007 15:56:35 +0100 (CET)
Subject: [Rd] integrate function (PR#9557)
Message-ID: <20070308145635.BF93819B3B@slim.kubism.ku.dk>

Full_Name: Bert De Boeck
Version: R 2.2.0
OS: Windows
Submission from: (NULL) (157.193.193.152)


I think there is a bug when using integrate for integrating a function which is
0 in a whole sub-interval. For example:

#define uniform function
f<-function(x){ifelse(x<1,0,ifelse(x<3,1,0))}

#this is the correct integral
integrate(f,-10,10)

#here there is a problem
integrate(f,-50,50)
integrate(f,-10,50)
integrate(f,-50,10)
integrate(f,-50,50,sub=10000)

# I noticed this for a more complex function, but as you see even for a trivial

# function there is a serious problem



[Rd] integrate function (PR#9557)
Bert.DeBoeck at Ugent.be