From: Sam Moore Date: Tue, 22 Apr 2014 10:38:13 +0000 (+0800) Subject: Handbook of Floating-Point Arithmetic X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c77d182fab831ff394c5b4cc586cc6e0becddf43;p=ipdf%2Fdocuments.git Handbook of Floating-Point Arithmetic Relatively recent (2010) textbook discussing floating point representations, issues, algorithms, hardware... --- diff --git a/LiteratureNotes.pdf b/LiteratureNotes.pdf index 6d6e3f7..4a11913 100644 Binary files a/LiteratureNotes.pdf and b/LiteratureNotes.pdf differ diff --git a/LiteratureNotes.tex b/LiteratureNotes.tex index 2814e4b..0e423ca 100644 --- a/LiteratureNotes.tex +++ b/LiteratureNotes.tex @@ -578,7 +578,12 @@ There is a version for multiplication. I'm still not quite sure when this is useful. I haven't been able to find an example for $x$ and $y$ where $x + y \neq \text{Fast2Sum}(x, y)$. +\section{Handbook of Floating-Point Arithmetic \cite{HFP}} +This book is amazingly useful and pretty much says everything there is to know about Floating Point numbers. +It is much easier to read than Goldberg or Priest's papers. + +I'm going to start working through it and compile their test programs. \chapter{General Notes} @@ -588,7 +593,14 @@ They happen. There is ULP and I don't mean a political party. TODO: Probably say something more insightful. Other than "here is a graph that shows errors and we blame rounding". -Results of \verb/calculatepi/ +\subsection{Results of calculatepi} + +We can calculate pi by numerically solving the integral: +\begin{align*} + \int_0^1 \left(\frac{4}{1+x^2}\right) dx &= \pi +\end{align*} + +Results with Simpson Method: \begin{figure}[H] \centering \includegraphics[width=0.8\textwidth]{figures/calculatepi.pdf} @@ -598,6 +610,20 @@ Results of \verb/calculatepi/ Tests with \verb/calculatepi/ show it's not quite as simple as just blindly replacing all your additions with Fast2Sum from Dekker\cite{dekker1971afloating}. ie: The graph looks exactly the same for single precision. \verb/calculatepi/ obviously also has multiplication ops in it which I didn't change. Will look at after sleep maybe. +\subsection{A sequence that seems to converge to a wrong limit - pgs 9-10, \cite{HFP}} + +\begin{align*} + u_n &= \left\{ \begin{array}{c} u_0 = 2 \\ u_1 = -4 \\ u_n = 111 - \frac{1130}{u_{n-1}} + \frac{3000}{u_{n-1}u_{n-2}}\end{array}\right. +\end{align*} + +The limit of the series should be $6$ but when calculated with IEEE floats it is actually $100$ +The authors show that the limit is actually $100$ for different starting values, and the error in floating point arithmetic causes the series to go to that limit instead. + +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{figures/handbook1-1.pdf} + \caption{Output of Program 1.1 from \emph{Handbook of Floating-Point Arithmetic}\cite{HFP} for various IEEE types} +\end{figure} \pagebreak \bibliographystyle{unsrt} diff --git a/figures/handbook1-1.pdf b/figures/handbook1-1.pdf new file mode 100644 index 0000000..5946fd7 Binary files /dev/null and b/figures/handbook1-1.pdf differ diff --git a/papers.bib b/papers.bib index fa6ae7b..ee4d247 100644 --- a/papers.bib +++ b/papers.bib @@ -571,7 +571,7 @@ keywords={IEEE standards;floating point arithmetic;programming;IEEE standard;ari doi={10.1109/IEEESTD.2008.4610935},} -@article{dekker1971afloating +@article{dekker1971afloating, year={1971}, issn={0029-599X}, journal={Numerische Mathematik}, @@ -585,3 +585,26 @@ author={Dekker, T.J.}, pages={224-242}, language={English} } + +@String{pub-BIRKHAUSER-BOSTON = "Birkh{\"a}user Boston Inc."} +@String{pub-BIRKHAUSER-BOSTON:adr = "Cambridge, MA, USA"} + +@Book{HFP, + author = "Jean-Michel Muller and Nicolas Brisebarre and Florent + de Dinechin and Claude-Pierre Jeannerod and Vincent + Lef{\`e}vre and Guillaume Melquiond and Nathalie Revol + and Damien Stehl{\'e} and Serge Torres", + title = "Handbook of Floating-Point Arithmetic", + publisher = pub-BIRKHAUSER-BOSTON, + address = pub-BIRKHAUSER-BOSTON:adr, + pages = "xxiii + 572", + year = "2010", + DOI = "http://dx.doi.org/10.1007/978-0-8176-4704-9", + ISBN = "0-8176-4704-X", + ISBN-13 = "978-0-8176-4704-9", + LCCN = "QA76.9.C62 H36 2010", + bibdate = "Thu Jan 27 16:18:58 2011", + price = "US\$90 (est.)", + acknowledgement = ack-nhfb, +} + diff --git a/references/hfp.pdf b/references/hfp.pdf new file mode 100644 index 0000000..9918c09 Binary files /dev/null and b/references/hfp.pdf differ