\documentclass[12pt]{article}

\usepackage[T1]{fontenc} 
\usepackage{fullpage,amsmath,amsfonts}

\begin{document}

\title{Foundations of Information Systems}
\author{Winter Semester 2024--25, Exercise 4}
\date{For discussion on Wednesday, November 13, 2024}
\maketitle

\begin{enumerate}

\item Identify values of $x$ for which there is a substantial growth
of relative error when the formula is evaluated in floating point
arithmetic (due to subtraction of almost equal numbers).  Then suggest
an alternate formula that improves accuracy for the problematic range
of $x$.
\begin{enumerate}
\item $\displaystyle \frac{1-(1-x)^3}{x}$
\item $\displaystyle \frac{1 - \sqrt{1-x^2}}x$
\item $\displaystyle \frac{1 - \sec x}{\tan^2 x}$
\end{enumerate}

\emph{Hint:} Recall that $\sec x = (\cos x)^{-1}$; use the well-known
trigonometric identity $\sec^2x = \tan^2x+1$.

\item Does the distributive law hold for floating point computations?

\item Let $a=1.0101 \cdot 2^{5}$ and $b=1.1101 \cdot 2^{3}$ be numbers
in binary floating point with a $5$-bit significant.  Compute
$a\oplus b$ and $a \ominus b$ by hand and state the absolute and the
relative error.

\item Convert the following single-precision floating bit
representation to decimal:
\begin{equation*}
  1 \, 10001010 \, 11000010000000000000000
\end{equation*}

\item Adapt the computation of propagation of floating point error to
the case of floating point division.  You should find that floating
point division has moderate growth of relative error for all numbers.



\end{enumerate}



\end{document}
