> Date: Sun, 9 Jan 2011 12:57:49 +0000
> From: c...@witthoft.com
> To: r-help@r-project.org
> Subject: Re: [R] how to calculate this natural logarithm
>
>
>
> You could re-do part of your code to run with mpfr-class variables, and use
> this function:
> # mpfr choose(n,k)
> rmpfac<-function(n,k,prec=50)
> factorial(mpfr(n,prec))/factorial(mpfr(k,prec))/factorial(mpfr(n-k,prec))
> Converting into and out of mpfr may not be worth it, but you will get all
> the precision you want without any nasty "Inf" results

Is the OP still here? I was curious what end result you were
after and if you tried any of these approaches. Apparently the quantity
here is something like 5000 which could probably itself
be an intermediate. If you took the approach of using algebra, as suggested
by earlier posters, and your
end result was supposed to be between 0 and 1, there would probably be
more simplifications to make. IIRC, you had terms like 
n!(2n!)
---------------------------
k!(n-k)!(600-k)!(2n-600+k)!
and you could cancel a lot ahead of time. You'd think
somewhere, like in statistical mechanics, this would be a well known
issue. 





> :-)
> Carl

                                          
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to