<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello Lester,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 30/12/2021 à 08:59, Lester Anderson
a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAE3taFAneowvBv0KPnjgjFAVnA0Ki2p6r81V+rKySU9yQCYPAQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello Samuel,
<div><br>
</div>
<div>Thanks for the solution. As pointed out it is best to show
the equation being assessed (from <a
href="http://www.bernoulli.org" moz-do-not-send="true">www.bernoulli.org</a>).
The one I looked at was the following:</div>
<div><br>
</div>
<div><img src="cid:part1.2WJeLikh.ie4BdXoe@free.fr"
alt="Explicit_formula.PNG" class="" width="468" height="101"><br>
</div>
<div><br>
</div>
<div>Using nchoosek in the original code gives the same issue. <br>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>The inner sum over v is very prone to cumulative rounding errors:<br>
The term v^n gets huge rapidly -- so is numerically truncated --,<br>
while the (-1)^v term makes the sum alternate, which enhances
residues...<br>
that then mainly come from numerical truncations.<br>
With n_max = 20, the maximum value of nchoosek(20,10)=184756<br>
and is definitely not an issue. While even only 13^13<br>
--> 13^13<br>
ans =<br>
3.029D+14<br>
is already not far from 1/%eps.<br>
The recurrent implementation proposed earlier and based on<span
style="color:rgb(0,0,0);"><br>
B</span><span style="color:rgb(0,0,0);">ₘ = -∑</span><sub><font
size="1"><span style="color:rgb(0,0,0);">k=0</span><span
style="color:rgb(0,0,0);"></span></font></sub><span
style="color:rgb(0,0,0);"><sub><font size="1"> → m-1</font></sub><font
size="1"> </font><font size="4">(C<sub> </sub><sup>k</sup><sub>m+1</sub>).B<sub>k</sub></font>
/(m+1)</span><span style="color:rgb(0,0,0);"></span></p>
<p><span style="color:rgb(0,0,0);"></span><span
style="color:rgb(0,0,0);">\frac{-1}{m+1}{\sum
_{{k=0}}^{{m-1}}{m+1 \choose k}B_k</span></p>
<p><span style="color:rgb(0,0,0);">has neither alternate terms nor
huge power values that make a<br>
direct computation numerically catastrophic.</span></p>
Regards<br>
Samuel<br>
<br>
</body>
</html>