On Mon, 14 Jun 2004, Ravi Varadhan wrote:
> Is it possible to perform computations in quadruple precision (more
> generally, with more digits in the floating-point arithmetic than that
> allowed by double precision) in R?
You are making the assumption that R uses double precision. Whereas R
uses C type `double', some compilers may allow you to allocate that to an
extended precision type. However, the most commonly used platforms and
compilers for R have no hardware or software support for `quadruple
precision', and it seems to have gone out of fashion.
Why do you ask? The data in the calculations is unlikely to be anything
like as accurate as standard double precision, and well-written algorithms
usually manage to give answers to within a hundred or so times that
precision. Unless, that is, the problem is ill conditioned, in which case
the exact answer will be sensitive to minute inaccuracies in the data (as
popularized by Lorenz's butterfly effect).
The only times I have ever needed extended precision were
- to handle exact calculations on very large integers and
- on such ill-conditioned problems.
One example was to explore the fine structure of pseudo-random number
generators. These days I would use an arbitrary-precision integer
computation package (and computer algebra packages often have such
facilities).
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595