Re: [Rd] qnbinom with small size is slow

2020-08-21 Thread Constantin Ahlmann-Eltze via R-devel
ange breaks anything. Best, Constantin Am 20.08.20 um 22:27 schrieb Martin Maechler: Constantin Ahlmann-Eltze via R-devel on Mon, 10 Aug 2020 10:05:36 +0200 writes: > Thanks Ben for verifying the issue. It is always reassuring to hear > when others can reproduce the problem.

Re: [Rd] qnbinom with small size is slow

2020-08-10 Thread Constantin Ahlmann-Eltze via R-devel
<- lapply(svec, function(x) { > cat(x,"\n") > replicate(10,ff(x)) > }) > > dd <- data.frame(size=rep(svec,each=10), > time=unlist(res)) > boxplot(log10(time)~size, dd) > summary(lm(log10(time)~size, data=dd, subset=time>0)

[Rd] qnbinom with small size is slow

2020-08-07 Thread Constantin Ahlmann-Eltze via R-devel
Hi all, I recently noticed that `qnbinom()` can take a long time to calculate a result if the `size` argument is very small. For example qnbinom(0.5, mu = 3, size = 1e-10) takes ~30 seconds on my computer. I used gdb to step through the qnbinom.c implementation and noticed that in line 106 (ht