From 1607309a00dde25b6814222699328017156457d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gi=C3=B9=20Marcer?= <giuliamarcer@yahoo.it>
Date: Tue, 26 May 2020 09:58:16 +0200
Subject: [PATCH] ex-2: revised section 2.2.1

---
 notes/sections/2.md | 52 +++++++++++++++++++++++++--------------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/notes/sections/2.md b/notes/sections/2.md
index c6759a2..9281c1a 100644
--- a/notes/sections/2.md
+++ b/notes/sections/2.md
@@ -43,44 +43,50 @@ $$
   | \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|$
------------ ------------- ---------------------
-\SI{2e1}{}                  \SI{2.48e-02}{}
+---------------------------------
+n           $|\gamma(n)-\gamma|$
+----------- ---------------------
+\SI{2e1}{}    \SI{2.48e-02}{}
 
-\SI{2e2}{}                  \SI{2.50e-03}{}
+\SI{2e2}{}    \SI{2.50e-03}{}
 
-\SI{2e3}{}                  \SI{2.50e-04}{}
+\SI{2e3}{}    \SI{2.50e-04}{}
 
-\SI{2e4}{}                  \SI{2.50e-05}{}
+\SI{2e4}{}    \SI{2.50e-05}{}
 
-\SI{2e5}{}                  \SI{2.50e-06}{}
+\SI{2e5}{}    \SI{2.50e-06}{}
 
-\SI{2e6}{}                  \SI{2.50e-07}{}
+\SI{2e6}{}    \SI{2.50e-07}{}
 
-\SI{2e7}{}                  \SI{2.50e-08}{}
+\SI{2e7}{}    \SI{2.50e-08}{}
 
-\SI{2e8}{}                  \SI{2.50e-09}{}
+\SI{2e8}{}    \SI{2.50e-09}{}
 
-\SI{2e9}{}                  \SI{2.55e-10}{}
+\SI{2e9}{}    \SI{2.55e-10}{}
 
-\SI{2e10}{}                 \SI{2.42e-11}{}
+\SI{2e10}{}   \SI{2.42e-11}{}
 
-\SI{2e11}{}                 \SI{1.44e-08}{}
------------------------------------------------
+\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