<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Algorithmes-D-Approximation | Dr. Goulu</title><link>https://drgoulu.com/tag/algorithmes-d-approximation/</link><atom:link href="https://drgoulu.com/tag/algorithmes-d-approximation/index.xml" rel="self" type="application/rss+xml"/><description>Algorithmes-D-Approximation</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>fr-FR</language><lastBuildDate>Fri, 06 Dec 2019 00:00:00 +0000</lastBuildDate><image><url>https://drgoulu.com/media/icon_hu_8d57a97d564ea9bb.png</url><title>Algorithmes-D-Approximation</title><link>https://drgoulu.com/tag/algorithmes-d-approximation/</link></image><item><title>Comment avons-nous découvert toutes les décimales de pi ?</title><link>https://drgoulu.com/2019/12/06/comment-avons-nous-decouvert-toutes-les-decimales-de-pi/</link><pubDate>Fri, 06 Dec 2019 00:00:00 +0000</pubDate><guid>https://drgoulu.com/2019/12/06/comment-avons-nous-decouvert-toutes-les-decimales-de-pi/</guid><description>&lt;p&gt;&lt;em&gt;Réponse publiée
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Il y a des programmes informatiques qui les calculent de façon très efficace.&lt;/p&gt;
&lt;p&gt;mon préféré est un algorithme incroyable qui travaille uniquement en nombres entiers
!&lt;/p&gt;
&lt;p&gt;Cette version Python se trouve dans ma
:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;def pi_digits_gen():
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;#39;&amp;#39;&amp;#39; generates pi digits as a sequence of INTEGERS ! using Jeremy Gibbons spigot generator
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;:see :http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/spigot.pdf &amp;#39;&amp;#39;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# code from http://davidbau.com/archives/2010/03/14/python_pipy_spigot.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; q, r, t, j = 1, 180, 60, 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; while True:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; u, y = 3*(3*j+1)*(3*j+2), (q*(27*j-12)+5*r)//(5*t)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; yield y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; q, r, t, j = 10*q*j*(2*j-1), 10*u*(q*(5*j-2)+r-y*t), t*u, j+1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A vrai dire, il ne calcule &amp;ldquo;que&amp;rdquo; 15'000 décimales correctes (incroyablement vite) mais il en existe d&amp;rsquo;autres qui vont beaucoup, beaucoup plus loin&lt;/p&gt;
&lt;p&gt;Il existe même des méthodes pour obtenir la n-ième décimale sans calculer les précédentes !&lt;/p&gt;
&lt;p&gt;Voir
&lt;/p&gt;
&lt;p&gt;Notes de bas de page&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;</description></item></channel></rss>