diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-03-17 15:35:52 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-03-17 15:35:52 +0000 |
commit | 5dc300ee973a86f1769a7d8cb6b13dcee1bc33bb (patch) | |
tree | e4c7abc964d280cc3e3f43caabc810b2fe0fd50b /doc | |
parent | 20f1e7bb79baaa3227036ea928986caab65d4c47 (diff) | |
download | mpfr-5dc300ee973a86f1769a7d8cb6b13dcee1bc33bb.tar.gz |
[doc/algorithms.*] A formula about radix conversion was incorrect
(and didn't match the correct code) when the output radix b is a
power of two. Added reference to Matula's "In-and-Out Conversions"
(correctness and optimality of the formula) and left a FIXME.
For more information, see the August/September discussion in the
MPFR list, particular subthreads starting at:
https://sympa.inria.fr/sympa/arc/mpfr/2012-08/msg00028.html
https://sympa.inria.fr/sympa/arc/mpfr/2012-09/msg00000.html
https://sympa.inria.fr/sympa/arc/mpfr/2012-09/msg00011.html
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9010 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'doc')
-rw-r--r-- | doc/algorithms.bib | 9 | ||||
-rw-r--r-- | doc/algorithms.tex | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/doc/algorithms.bib b/doc/algorithms.bib index 7c2d7835e..27360f79a 100644 --- a/doc/algorithms.bib +++ b/doc/algorithms.bib @@ -233,3 +233,12 @@ url = {http://www.inria.fr/rrrt/rr-5852.html}, editor = {Elisardo Antelo and David Hough and Paolo Ienne}, publisher = {IEEE Computer Society}} +@Article{Mat68, + author = {David W. Matula}, + title = {In-and-Out Conversions}, + journal = {Communications of the ACM}, + year = 1968, + volume = 11, + number = 1, + pages = {47--50} +} diff --git a/doc/algorithms.tex b/doc/algorithms.tex index 4e98525c9..9f389a956 100644 --- a/doc/algorithms.tex +++ b/doc/algorithms.tex @@ -4295,9 +4295,11 @@ $$ \wprec = \precc + 1 + 4 + \lceil \log_2(4\kvar)\rceil + \cond - \Exp(\svar). \subsection{Radix Conversion} +% FIXME: correct the following when b is a power of two. + The \texttt{mpfr\_get\_str} function with size $0$ and base $b$ chooses an output precision of $1 + \lceil e \log(2)/\log(b) \rceil$ for a precision -of $e$ bits. +of $e$ bits if $b$ is not a power of two.\cite{Mat68} However the code uses instead $1 + \lceil e y \rceil$, where $y$ is an upper $76$-bit approximation of $\log(2)/\log(b)$. When do both values differ? |