<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Le 24/07/2020 à 13:11, Samuel Gougeon a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:30305427-6ff4-425a-a068-9802389a8ac3@free.fr">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<br>
<p>.../...<br>
How to apply any absolute tolerance is quite clear (although
unsafe). IMHO the absolute tolerance must be set to 0 (so not
keeping the default one set to 1e-10), for the reason given
hereabove.<br>
</p>
</blockquote>
<p><br>
</p>
<p>I meant, in %r_simp(). In %r_clean(), taking the actual input
absolute tolerance is obviously mandatory.<br>
</p>
<blockquote type="cite"
cite="mid:30305427-6ff4-425a-a068-9802389a8ac3@free.fr">
<p> How to use and apply the relative tolerance is more
debatable. Presently, for a given rational, no comparison is
done between coefficients of its numerator and the corresponding
ones of its denominator. We could consider doing things is this
way.</p>
</blockquote>
<p><br>
</p>
<p>Either in both %r_clean() and %r_simp(), or only in %r_simp() to
decide when simplifying. By the way, the comparison could be done
either alone, or after applying clean() to the num and den
separately.<br>
A possible proposal:</p>
<ul>
<li>keep %r_clean() as is: num and den are cleaned separately.<br>
<br>
</li>
<li>%r_simp(): to decide any denom=1 simplification for a given
rational, do<br>
</li>
<ul>
<li>apply clean(rational, 0, %eps). <br>
Then: <br>
</li>
<li>if degree(numer) <= degree(denom) and if for all numer(i)
coefficients clean([numer(i) denom(i)], 0, %eps) sets numer(i)
to 0</li>
<ul>
<li>Then actually set numer=0 and denom=1</li>
<li>Otherwise: keep the rational as is.</li>
</ul>
</ul>
</ul>
<p>We could illustrate with some critical examples of inputs and
results<br>
</p>
<p>SG<br>
<br>
</p>
</body>
</html>