[metapost] Metapost 2.1 and interval arithmetic

Pétiard François petiard.francois at free.fr
Wed Feb 21 10:07:43 CET 2024


Hello

Sorry but I don't see the difference between x*x and x^2 ???

And I don't understand why w*w=[-1,1] ???

Maybe it's : w*w is the set {x*y : x in w ; y in w} ?

François

Le 21/02/2024 à 09:24, luigi scarso a écrit :
>    From mpman.pdf
> """
> The interval number system MPFI [14], introduced in version 2.10, is 
> built on the top of the
> MPFR library and an interval quantity [number,number] is created with
>                                w := interval_set(number,number);
> An interval is a set, the left extrema being
>                            l := interval_get_left_endpoint(interval);
> and the right extrema
>                           r := interval_get_right_endpoint(interval);
> and it’s always 𝑙 ≤ 𝑟 ; a number x is always seen as the interval 
> [x,x], i.e. a set with one element. At
> first glance, interval arithmetic can be confusing:
>  if 𝑤 is an interval, 𝑤 * 𝑤 is the set {𝑥 * 𝑥 : 𝑥 ∈ 𝑤},
> but 𝑓 (𝑤) = 𝑤^2 is the set {𝑓 (𝑥) : 𝑥 ∈ 𝑤} = {𝑥^2 : 𝑥 ∈ 𝑤 } :
> if 𝑤 = [−1, 1] then 𝑤 * 𝑤 = [−1, 1] and 𝑤^2 = [0, 1].
> On the other hand, it’s easy to verify that 𝑤 * 𝑤 * 𝑤 = 𝑤^3 always.
> For this reason, given that currently the implementation of the 
> MetaPost functions in MPFI mimics those of MPFR and they are not 
> adapted to the interval arithmetic, the main utility of interval mode 
> is the implementation of algorithms in MetaPost language.
>
> [14] Nathalie Revol and Fabrice Rouillier. Motivations for an 
> arbitrary precision interval arithmetic
>      and the MPFI library. Reliab. Comput., 11(4):275–290, 2005.
> """
> See also
> https://perso.ens-lyon.fr/nathalie.revol/software.html
> https://www.reliable-computing.org/
> https://en.wikipedia.org/wiki/Interval_arithmetic
>
> --
> luigi
>
>
> --
> http://tug.org/metapost/


More information about the metapost mailing list.