ex-2: revised section 2.2.1
This commit is contained in:
parent
8f4bbe7d52
commit
1607309a00
@ -43,11 +43,11 @@ $$
|
||||
| \gamma(n_{i+1}) - \gamma | > | \gamma(n_i) - \gamma|
|
||||
$$
|
||||
|
||||
and $\gamma (n_i)$ was selected as the result (see @tbl:1_results).
|
||||
and $\gamma (n_i)$ was selected as the best result (see @tbl:1_results).
|
||||
|
||||
-----------------------------------------------
|
||||
n sum $|\gamma(n)-\gamma|$
|
||||
----------- ------------- ---------------------
|
||||
---------------------------------
|
||||
n $|\gamma(n)-\gamma|$
|
||||
----------- ---------------------
|
||||
\SI{2e1}{} \SI{2.48e-02}{}
|
||||
|
||||
\SI{2e2}{} \SI{2.50e-03}{}
|
||||
@ -69,18 +69,24 @@ n sum $|\gamma(n)-\gamma|$
|
||||
\SI{2e10}{} \SI{2.42e-11}{}
|
||||
|
||||
\SI{2e11}{} \SI{1.44e-08}{}
|
||||
-----------------------------------------------
|
||||
---------------------------------
|
||||
|
||||
Table: Partial results using the definition of $\gamma$ with double
|
||||
precision. {#tbl:1_results}
|
||||
|
||||
The convergence is logarithmic: to fix the first $d$ decimal places, about
|
||||
$10^d$ terms are needed. The double precision runs out at the
|
||||
10\textsuperscript{th} place, $n=\SI{2e10}{}$.
|
||||
Since all the number are given with double precision, there can be at best 15
|
||||
correct digits but only 10 were correctly computed: this means that when the
|
||||
terms of the series start being smaller than the smallest representable double,
|
||||
the sum of all the remaining terms give a number $\propto 10^{-11}$.
|
||||
$10^d$ terms of the armonic series are needed. The double precision runs out at
|
||||
the $10^{\text{th}}$ place, at $n=\SI{2e10}{}$.
|
||||
Since all the number are given with double precision, there can be at best 16
|
||||
correct digits, since for a double 64 bits are allocated in memory: 1 for the
|
||||
sign, 8 for the exponent and 55 for the mantissa:
|
||||
$$
|
||||
2^{55} = 10^{d} \thus d = 55 \cdot \log(2) \sim 16.6
|
||||
$$
|
||||
|
||||
Only 10 digits were correctly computed: this means that when the terms of the
|
||||
series start being smaller than the smallest representable double, the sum of
|
||||
all the remaining terms gives a number $\propto 10^{-11}$.
|
||||
Best result in @tbl:first.
|
||||
|
||||
--------- -----------------------
|
||||
@ -106,7 +112,7 @@ $$
|
||||
|
||||
Varying $M$ from 1 to 100, the best result was obtained for $M = 41$ (see
|
||||
@tbl:second). It went sour: the convergence is worse than using the definition
|
||||
itself. Only two places were correctly computed (#@tbl:second).
|
||||
itself. Only two places were correctly computed (@tbl:second).
|
||||
|
||||
--------- -----------------------
|
||||
true: 0.57721\ 56649\ 01533
|
||||
|
Loading…
Reference in New Issue
Block a user