X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fsam.git;a=blobdiff_plain;f=presentation%2Fpresentation.tex;fp=presentation%2Fpresentation.tex;h=7d5494b8602e242c60b0813fdee46066bc929c4e;hp=9ad4c78e95112d8d264d5a067b9bc8346272aad4;hb=67c33e185edd820e2ea6fef334455645bacd432b;hpb=9fcf44a0c34f393689118e913a2d17d907036c85 diff --git a/presentation/presentation.tex b/presentation/presentation.tex index 9ad4c78..7d5494b 100644 --- a/presentation/presentation.tex +++ b/presentation/presentation.tex @@ -38,7 +38,7 @@ {Supervisors: Tim French, Rowan Davies} \date[CSS 2009]{\today} % change the actual date - \titlegraphic{\includegraphics[width=3cm]{./Logos/WAMSI.png}} + %\titlegraphic{\includegraphics[width=3cm]{./Logos/WAMSI.png}} %% Optional stuff------------------------------------------------------------------ @@ -121,28 +121,13 @@ \frametitle{Visualisation of Floats} \begin{itemize} \item \small{With total length of $m$ and $E$ limited to $7$ bits (1 sign bit)} - \item Showing positive numbers only + \item Operations are inexact (in general) \end{itemize} \centering \includegraphics[width=0.8\textwidth]{../figures/floats.pdf} - \end{frame} -\begin{frame} -\frametitle{Floating point calculations \\ go wrong} -\begin{itemize} - \item At scale of only $1\times 10^{-6}$, the fox is very sick -\end{itemize} -\centering - \includegraphics[width=0.5\textwidth]{../figures/fox-vector_highzoom1.png} - \begin{itemize} - \item Plank Length: $1.61 \times 10^{-35}$ metres $ > 3\times10^{-38}$ - \item Size of Universe: $4.3 \times 10^{26}$ metres $ << 3 \times10^{38}$ - \item Why isn't this good enough for $1\times 10^{-6}$ - \end{itemize} -\end{frame} -\section{Implementing a Basic SVG Viewer} \begin{frame} \frametitle{Structure of Vector Graphics} \begin{itemize} @@ -164,6 +149,51 @@ \includegraphics[width=0.5\textwidth]{../figures/fox-vector_face_with_bezbounds.png} \end{frame} + +\begin{frame} +\frametitle{Floating point calculations \\ go wrong} +\begin{itemize} + \item Scaled to $~1\times 10^{-6}$, the fox is very sick +\end{itemize} +\centering + \includegraphics[width=0.5\textwidth]{../figures/fox-vector_highzoom1.png} + +\end{frame} + + +\begin{frame} + \frametitle{Arbitrary Precision Rationals} + \begin{align} + Q &= \frac{N}{D} + \end{align} + \begin{itemize} + \item $N$ and $D$ are arbitrary precision integers + \end{itemize} + \begin{align} + N &= \sum_{i=0}^{S} d_i \beta^{i} + \end{align} + \begin{itemize} + \item $d_i$ are fixed size integers, $\beta = 2^{64}$ + \item Size $S$ grows as needed + \item Operations are always exact + \item Implemented by GNU Multiple Precision Library + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Replace floats with rationals?} + \begin{itemize} + \item Rationals are \emph{slow} + \item Screen coordinates always in range $0 \to 1$ + \item Introduce intermediate coordinate system + \begin{itemize} + \item Many B\'{e}ziers contained in a Path + \item Use Rationals for bounds of the Path + \item Use floats to transform B\'{e}zier coordinates + \end{itemize} + \end{itemize} +\end{frame} + \section{Live Demo} \begin{frame} \frametitle{Live Demo} @@ -195,7 +225,21 @@ \end{itemize} \end{frame} \section{References} - +\begin{frame} + \frametitle{References \& More information} + \begin{itemize} + \item Work on SVG viewer collaborative with David Gow + \begin{itemize} + \item See David Gow's presentation about Quadtrees + \end{itemize} + \item Muller et al, \emph{Handbook of Floating Point Arithmetic}, + \item Hearn, Baker \emph{Computer Graphics} + \item Kahan et al, \emph{IEEE-754} (1985 and 2008 revision) + \item Dahlst{\'o}m et al, \emph{SVG WC3 Recommendation 2011} + \item Grunland et al, \emph{GNU Multiple Precision Manual 6.0.0a} + \item Kahan's website \url{http://http.cs.berkeley.edu/~wkahan} + \end{itemize} +\end{frame} \section{Questions} \begin{frame} @@ -220,20 +264,48 @@ \begin{frame} \frametitle{Q: Arbitrary precision floats?} +\begin{align} + X &= m \times 2^{E} +\end{align} \begin{itemize} - \item We support them as well! - \item Rationals are more convenient: + \item $m$ and $E$ are of arbitrary size + \item Implemented by MPFR or GMP + \item Difficulties: \begin{itemize} - \item Need to manually set precision + \item Need to manually set precision (size) of $m$ \item Some operations require infinite precision: \begin{align} \frac{1}{3} &= 0.3333333333333333333333 \text{ ... } \times 10^0 \end{align} \item How do you choose when to increase precision? \end{itemize} - \item Could be future work \end{itemize} \end{frame} +\begin{frame} + \frametitle{Floating Point calculations \\ go wrong} + \begin{itemize} + \item Plank Length: $1.61 \times 10^{-35}$ metres $ > 3\times10^{-38}$ + \item Size of Universe: $4.3 \times 10^{26}$ metres $ << 3 \times10^{38}$ + \item Why isn't this good enough for $1\times 10^{-6}$ + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Floating point calculations \\ go wrong} + \begin{itemize} + \item Transforming from document $(x,y)$ $\to$ screen $(X,Y)$ + \item View is at $(v_x,v_y)$ in document, has dimensions $(v_w,v_h)$ + \end{itemize} + \begin{align} + X = \frac{x - v_x}{v_w} &,\quad\quad Y = \frac{y - v_y}{v_h} + \end{align} + \begin{itemize} + \item Division by $v_w \approx 10^{-6}$ increases the error due to $x - v_x$ + \item Using \emph{double} precision, render correctly down to $v_w \approx 10^{-37}$ + \end{itemize} +\end{frame} + + \end{document}