Error and Relative Error of Approximations

# Error and Relative Error of Approximations

In many applications of mathematics, we are often interested in knowing accuracy of an approximate value $x_A$ base on its error and relative error from the true value $x_T$. We will define these terms below.

 Definition: The Error or Absolute Error between the true value $x_T$ and the approximate value $x_A$ is denoted $\mathrm{Error}(x_A) = x_T - x_A$. The Relative Error between the true value $x_T$ and the approximate value $x_A$ is denoted $\mathrm{Rel}(x_A) = \frac{x_T - x_A}{x_T}$ provided that $x_T \neq 0$.

Some people define the error $x_A$ and $x_T$ to be $\mathrm{Error}(x_A) = \mid x_T - x_A \mid$ and the relative error between $x_A$ and $x_T$ to be $\mathrm{Rel}(x_A) = \frac{\mid x_T - x_A \mid}{\mid x_T \mid}$.

It should be noted that the error of $x_A$ is going to be how far off $x_A$ is from $x_T$, meanwhile, the relative error of $x_A$ is going to be a percentage of how far off $x_A$ is relative to $x_T$. For example, suppose that $x_T = 4$ and $x_A = 3.5$. Then the error is $\mathrm{Error} \left ( 3.5 \right) = 0.5$, while the relative error is $\mathrm{Rel} \left ( 3.5 \right ) = \frac{0.5}{4} = 0.125$. Now consider the example $x_T = 100$ and $x_A = 99.5$. Then the error is $\mathrm{Error} \left ( 99.5 \right ) =0.5$, while the relative error is $\mathrm{Rel} \left ( 99.5 \right ) = \frac{0.5}{100} = 0.005$.

In the two examples above, notice that the errors between the true and actual values are equal, however, the relative errors are much different. Thus, the relative error gives us a more concise picture of how accurate $x_A$ is from $x_T$.

Let's look at some examples of finding the error and relative errors of approximate values $x_A$ from true values $x_T$.

## Example 1

Compute the error and relative error when $x_T = 0.3320$ and $x_A = 0.3321$.

Using the formula above, we have that the error of $x_A$ from $x_T$ is:

(1)
\begin{align} \quad \mathrm{Error} (x_A) = x_T - x_A = 0.3320 - 0.3321 = -0.0001 \end{align}

Now the relative error of $x_A$ from $x_T$ is:

(2)
\begin{align} \quad \mathrm{Rel} (x_A) = \frac{x_T - x_A}{x_T} = \frac{-0.0001}{0.3320} \approx -0.00030120... \end{align}

## Example 2

A polynomial $p(x)$ is used to approximate a function $f(x)$ that is difficult to compute at $x = 0$. We find that $p(0) = 9.1111334$ and the true value $f(0) = 9.1122114$. Find the error and relative error of $p(0)$ from $f(0)$.

Using the formula above, we have that the error of $p(0)$ (our approximate value) from $f(0)$ (the actual value) is:

(3)
\begin{align} \quad \mathrm{Error} (p(0)) = f(0) - p(0) = 9.1122114 - 9.1111334 = 0.001078 \end{align}

Now the relative error of $p(0)$ from $f(0)$ is:

(4)
\begin{align} \quad \mathrm{Rel} (p_0) = \frac{f(0) - p(0)}{f(0)} = \frac{0.001078}{9.1122114} \approx 0.0001183... \end{align}

Note that Example 2 above is not a realistic scenario. If we knew the value of $f$ at $x = 0$, then there would be no reason to approximate $f$ with a polynomial $p$. We will see later that sometimes we do not know $f$ directly, and instead, we may be able to determine the maximum error that an approximate can have from the true value.