## Subsection6.3.1Initial insights

Before giving a general result, let us focus on the case where the vectors $x$ and $y$ have only a few elements:

###### Example6.3.1.1.

Consider

\begin{equation*} x = \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right) \mbox{ and } y = \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right) \end{equation*}

and the computation

\begin{equation*} \kappa \becomes x^T y . \end{equation*}

Under the computational model given in (((Unresolved xref, reference "stability-model-of-floating-point-computation"; check spelling or use "provisional" attribute))) , the computed result, $\check \kappa \text{,}$ satisfies

$$\check \kappa = \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right)^T \left( \begin{array}{c c } ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \amp0 \\0 \amp ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right) \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right). \label{chapter06-stab-dot-1}\tag{6.3.1}$$
Solution
\begin{equation*} \begin{array}{l} \check \kappa \\ ~~~= ~~~~ \lt \check \kappa = [ x^T y ] \gt \\ \left[ \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right)^T \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right) \right] \\ ~~~= ~~~~ \lt \mbox{ definition of } x^T y \gt \\ \left[ \chi_0 \psi_0 + \chi_1 \psi_1 \right] \\ ~~~= ~~~~ \lt \mbox{ each suboperation is performed in floating point arithmetic } \gt \\ \left[ \left[\chi_0 \psi_0\right] + \left[\chi_1 \psi_1\right] \right] \\ ~~~= ~~~~ \lt \mbox{ apply SCM multiple times } \gt \\ \left[ \chi_0 \psi_0 ( 1 + \epsilon_*^{(0)}) + \chi_1 \psi_1 ( 1 + \epsilon_*^{(1)}) \right] \\ ~~~= ~~~~ \lt \mbox{ distribute } \gt \\ ( \chi_0 \psi_0 ( 1 + \epsilon_*^{(0)}) + \chi_1 \psi_1 ( 1 + \epsilon_*^{(1)}) ) ( 1 + \epsilon_+^{(1)}) \\ ~~~= ~~~~ \lt \mbox{ distribute } \gt \\ \chi_0 \psi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) + \chi_1 \psi_1 ( 1 + \epsilon_*^{(1)}) ( 1 + \epsilon_+^{(1)}) \\ ~~~= ~~~~ \lt \mbox{ commute } \gt \\ \chi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \psi_0 + \chi_1 ( 1 + \epsilon_*^{(1)}) ( 1 + \epsilon_+^{(1)}) \psi_1 \\ ~~~= ~~~~ \lt \mbox{ (perhaps too) slick way of expressing the final result } \gt \\ % \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right)^T % \left( \begin{array}{c} \psi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \\ \psi_1 ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right) % \\ % \amp=\amp \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right)^T \left( \begin{array}{c c } ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \amp0 \\0 \amp ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right) \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right) \\ % \amp=\amp % \left( \begin{array}{c} \chi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \\ \chi_1 ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right)^T % \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right) , \end{array} \end{equation*}

where $\vert \epsilon_{*}^{(0)} \vert , \vert \epsilon_{*}^{(1)} \vert, \vert \epsilon_{+}^{(1)} \vert \leq \meps \text{.}$

An important insight from this example is that the result in (6.3.1) can be manipulated to associate the accummulated error with vector $x$ as in

\begin{equation*} \check \kappa = \left( \begin{array}{c} \chi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \\ \chi_1 ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right)^T \left( \begin{array}{c} \psi_0 \\ \psi_1 \end{array} \right) \end{equation*}

or with vector $y$

\begin{equation*} \check \kappa = \left( \begin{array}{c} \chi_0 \\ \chi_1 \end{array} \right)^T \left( \begin{array}{c} \psi_0 ( 1 + \epsilon_*^{(0)})( 1 + \epsilon_+^{(1)}) \\ \psi_1 ( 1 + \epsilon_*^{(1)})( 1 + \epsilon_+^{(1)})\end{array} \right) . \end{equation*}

This will play a role when we later analyze algorithms that use the dot product.

###### Homework6.3.1.1.

Consider

\begin{equation*} x = \left( \begin{array}{c} \chi_0 \\ \chi_1 \\ \chi_2 \end{array} \right) \mbox{ and } y = \left( \begin{array}{c} \psi_0 \\ \psi_1 \\ \psi_2 \end{array} \right) \end{equation*}

and the computation

\begin{equation*} \kappa \becomes x^T y \end{equation*}

computed in the order indicated by

\begin{equation*} \kappa := ( \chi_0 \psi_0 + \chi_1 \psi_1 ) + \chi_2 \psi_2. \end{equation*}

Employ the SCM given in Subsubsection 6.2.3.2, to derive a result similar to that given in (6.3.1).

where $\vert \epsilon_{*}^{(0)} \vert , \vert \epsilon_{*}^{(1)} \vert, \vert \epsilon_{+}^{(1)} \vert , \vert \epsilon_{*}^{(2)} \vert, \vert \epsilon_{+}^{(2)} \vert \leq \meps \text{.}$
where $\vert \epsilon_{*}^{(0)} \vert , \vert \epsilon_{*}^{(1)} \vert, \vert \epsilon_{+}^{(1)} \vert , \vert \epsilon_{*}^{(2)} \vert, \vert \epsilon_{+}^{(2)} \vert \leq \meps \text{.}$