mirror of
https://github.com/NotXia/unibo-ai-notes.git
synced 2025-12-15 19:12:22 +01:00
Fix finite number example
This commit is contained in:
@ -194,11 +194,12 @@ A floating-point operation causes a small rounding error:
|
|||||||
However, some operations may be subject to the \textbf{cancellation} problem which causes information loss.
|
However, some operations may be subject to the \textbf{cancellation} problem which causes information loss.
|
||||||
\marginnote{Cancellation}
|
\marginnote{Cancellation}
|
||||||
\begin{example}
|
\begin{example}
|
||||||
Given $x = 1$ and $y = 1 \cdot 10^{-16}$, we want to compute $x + y$ in $\mathcal{F}(10, 16, U, L)$.\\
|
Given $x = 1$ and $y = 1 \cdot 10^{-17}$, we want to compute $x + y$ in $\mathcal{F}(10, 16, U, L)$.
|
||||||
|
It is assumed that $U$ and $L$ are sufficient for this example.
|
||||||
\begin{equation*}
|
\begin{equation*}
|
||||||
\begin{split}
|
\begin{split}
|
||||||
z & = \texttt{fl}(x) + \texttt{fl}(y) \\
|
z & = \texttt{fl}(x) + \texttt{fl}(y) \\
|
||||||
& = 0.1 \cdot 10^1 + 0.1 \cdot 10^{-15} \\
|
& = 0.1 \cdot 10^1 + 0.1 \cdot 10^{-16} \\
|
||||||
& = (0.1 + 0.\overbrace{0\dots0}^{\mathclap{16\text{ zeros}}}1) \cdot 10^1 \\
|
& = (0.1 + 0.\overbrace{0\dots0}^{\mathclap{16\text{ zeros}}}1) \cdot 10^1 \\
|
||||||
& = 0.1\overbrace{0\dots0}^{\mathclap{15\text{ zeros}}}1 \cdot 10^1
|
& = 0.1\overbrace{0\dots0}^{\mathclap{15\text{ zeros}}}1 \cdot 10^1
|
||||||
\end{split}
|
\end{split}
|
||||||
|
|||||||
Reference in New Issue
Block a user