Le 24/07/2020 à 13:11, Samuel Gougeon a écrit :
.../...
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.
I meant, in %r_simp(). In %r_clean(), taking the actual input absolute
tolerance is obviously mandatory.
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.
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.
A possible proposal:
* keep %r_clean() as is: num and den are cleaned separately.
* %r_simp(): to decide any denom=1 simplification for a given rational, do
o apply clean(rational, 0, %eps).
Then:
o if degree(numer) <= degree(denom) and if for all numer(i)
coefficients clean([numer(i) denom(i)], 0, %eps) sets numer(i) to 0
+ Then actually set numer=0 and denom=1
+ Otherwise: keep the rational as is.
We could illustrate with some critical examples of inputs and results
SG
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users