[R-SIG-Mac] float vs double on Macs (or PCs?)

Bill Northcott w.northcott at unsw.edu.au
Fri Mar 25 04:06:56 CET 2005


On 25/03/2005, at 9:43 AM, Thomas Lumley wrote:

> Note that R does have support for single precision in .C, so adding
> methods to solve(), eigen(), %*%, that directly call the single 
> precision
> BLAS and LAPACK could be worthwhile even in the absence of full 
> support.
> On the other hand, if you save only 4 seconds on 2000 multiplies of
> 1000x1000 matrices, it would take a big problem to justify even this.
>
My musing was really going outside LAPACK.

I want to run MCMCs.  So I have been looking at JAGS which uses the 
Rmath library and analysing the speed issues.  Shark (code profiler) 
clearly shows that JAGS spends all its time in R code which computes 
draws from distributions for the MCMC.  If we could get a 3 fold speed 
up, as for LAPACK on the G5, the MCMC should run at least twice as 
fast, which is not trivial.

I am also involved in Swarm and Marcus Daniels has written some Altivec 
optimised RNG code for that, but I have not had a chance to look at it.

I am also not sure this discussion is Mac specific.  I know that on x86 
JAGS using R code runs much more slowly than WinBUGS for the same 
model.  It seems to me this is also an R issue, and hence there may be 
some utility in having the option to use floats in some of these 
computations.

Bill Northcott



More information about the R-SIG-Mac mailing list