27.12.2012 Views

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

-5<br />

-7.5<br />

-10<br />

-12.5<br />

10<br />

20<br />

30<br />

ne<br />

40<br />

50<br />

0<br />

6Towards a quadratu<strong>re</strong> rout<strong>in</strong>e<br />

Figu<strong>re</strong> 6.10: Negative number of cor<strong>re</strong>ct digits, log e S (k)<br />

n , S , for vary<strong>in</strong>g n (ns) and k (ne), computed<br />

with the 2 algorithm (WynnDeg<strong>re</strong>e->1) and the zeros of the <strong>in</strong>tegrand as partition po<strong>in</strong>ts.<br />

of sequence members used <strong>in</strong> the extrapolation as well as the p<strong>re</strong>cision of the <strong>in</strong>ternal<br />

computations. We have al<strong>re</strong>ady noticed that it is most promis<strong>in</strong>g to use the enti<strong>re</strong><br />

sequence for this purpose rather than to shift the start<strong>in</strong>g po<strong>in</strong>t for the extrapolation<br />

to higher <strong>in</strong>dex values.<br />

3. The parameter to be controlled is the accuracy of the <strong>re</strong>sult or | <strong>in</strong> other words<br />

| its error. We thus need a function that gives us an a posteriori estimate of the<br />

approximation error.<br />

A simple way to obta<strong>in</strong> an error estimate <strong>in</strong> Mathematica is to use the functions Accuracy<br />

and P<strong>re</strong>cision on the <strong>re</strong>sult of a numerical computation. The former <strong>re</strong>turns the number of<br />

signi cant digits to the right of the decimal po<strong>in</strong>t and the<strong>re</strong>fo<strong>re</strong> is a measu<strong>re</strong> for the absolute<br />

error. The latter gives the total number of signi cant digits <strong>in</strong> a oat<strong>in</strong>g-po<strong>in</strong>t number. For<br />

very small numbers, the zeros between the decimal po<strong>in</strong>t and the rst non-zero digit a<strong>re</strong> not<br />

counted, thus the p<strong>re</strong>cision of a number denotes its <strong>re</strong>lative error (see also the explanations<br />

<strong>in</strong> example 6.3.1).<br />

Unfortunately, these two functions work only with variable-p<strong>re</strong>cision arithmetic, which cannot<br />

make use of the fast hardwa<strong>re</strong>-based mach<strong>in</strong>e-p<strong>re</strong>cision operations. Instead, it is implemented<br />

<strong>in</strong> softwa<strong>re</strong> to keep track of the uncerta<strong>in</strong>ty associated with every number <strong>in</strong> the calculation,<br />

which makes it much slower than mach<strong>in</strong>e-p<strong>re</strong>cision arithmetic. For this <strong>re</strong>ason, when Mathematica<br />

comes across a mach<strong>in</strong>e number <strong>in</strong> the course of the computation, all subsequent<br />

156<br />

20<br />

40<br />

ns<br />

60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!