next up previous
Next: Polynomial arithmetic and roots Up: Exact Real Computation in Previous: Example 1

Example 2

Computation of the errors for the integer power

It is known that, given a differentiable function $ f:[a,b]\to {\bf R}$, $ \vert x-y\vert\le \delta$ implies $ \vert f(x)-f(y)\vert\le M\delta$, where $ \displaystyle M = \mathop{\rm sup}\limits_{x_0\in[a,b]}
\left(\frac{\partial f}{\partial x}(x_0)\right)$.

Let $ r$ be a real number, $ n$ natural and $ r_0$ a known approximation of accuracy $ \delta$.

Then the accuracy of $ r_0^n$ as an approximation of $ r^n$ is at least $ \delta n (\vert r_0\vert+\delta)^{n-1}$.

If we want to get $ r^n$ with an accuracy $ \varepsilon$, then we need $ r$ with accuracy:

$\displaystyle \tilde\delta = \frac{\varepsilon}{n(\vert r_0\vert+\delta)^{n-1}}.
$