Metapost 2.1 and interval arithmetic
luigi scarso <[email protected]> Wed, 21 Feb 2024 09:24:39 +0100
| Newsgroups | gmane.comp.tex.metapost |
|---|---|
| Message-ID | <CAG5iGsAT5N5nzW-4qkDagc8yXTZqzwe8drdq=oa1gU-6dkJTwA@mail.gmail.com> |
--===============2805541455177382471==
Content-Type: multipart/alternative; boundary="0000000000007e81980611e00f86"
--0000000000007e81980611e00f86
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 :=3D interval_set(number,number);
An interval is a set, the left extrema being
l :=3D interval_get_left_endpoint(interval);
and the right extrema
r :=3D interval_get_right_endpoint(interval);
and it=E2=80=99s always =F0=9D=91=99 =E2=89=A4 =F0=9D=91=9F ; 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 =F0=9D=91=A4 is an interval, =F0=9D=91=A4 * =F0=9D=91=A4 is the set {=
=F0=9D=91=A5 * =F0=9D=91=A5 : =F0=9D=91=A5 =E2=88=88 =F0=9D=91=A4},
but =F0=9D=91=93 (=F0=9D=91=A4) =3D =F0=9D=91=A4^2 is the set {=F0=9D=91=93=
(=F0=9D=91=A5) : =F0=9D=91=A5 =E2=88=88 =F0=9D=91=A4} =3D {=F0=9D=91=A5^2 =
: =F0=9D=91=A5 =E2=88=88 =F0=9D=91=A4 } :
if =F0=9D=91=A4 =3D [=E2=88=921, 1] then =F0=9D=91=A4 * =F0=9D=91=A4 =3D [=
=E2=88=921, 1] and =F0=9D=91=A4^2 =3D [0, 1].
On the other hand, it=E2=80=99s easy to verify that =F0=9D=91=A4 * =F0=9D=
=91=A4 * =F0=9D=91=A4 =3D =F0=9D=91=A4^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=E2=80=93290, 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
--0000000000007e81980611e00f86
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">=C2=A0 =C2=A0From mpman.pdf<br>"""<br>The i=
nterval number system MPFI [14], introduced in version 2.10, is built on th=
e top of the<br>MPFR library and an interval quantity [number,number] is cr=
eated with<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0w :=3D interval_set(num=
ber,number);<br>An interval is a set, the left extrema being<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0l :=3D interval_get_left_endpoint(interval);<br>and the right =
extrema<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 r :=3D interval_get_right_endpoint(interval);<b=
r>and it=E2=80=99s always =F0=9D=91=99 =E2=89=A4 =F0=9D=91=9F ; a number x =
is always seen as the interval [x,x], i.e. a set with one element. At<br>fi=
rst glance, interval arithmetic can be confusing:<br>=C2=A0if =F0=9D=91=A4 =
is an interval, =F0=9D=91=A4 * =F0=9D=91=A4 is the set {=F0=9D=91=A5 * =F0=
=9D=91=A5 : =F0=9D=91=A5 =E2=88=88 =F0=9D=91=A4},<br>but =F0=9D=91=93 (=F0=
=9D=91=A4) =3D =F0=9D=91=A4^2 is the set {=F0=9D=91=93 (=F0=9D=91=A5) : =F0=
=9D=91=A5 =E2=88=88 =F0=9D=91=A4} =3D {=F0=9D=91=A5^2 : =F0=9D=91=A5 =E2=88=
=88 =F0=9D=91=A4 } :<br>if =F0=9D=91=A4 =3D [=E2=88=921, 1] then =F0=9D=91=
=A4 * =F0=9D=91=A4 =3D [=E2=88=921, 1] and =F0=9D=91=A4^2 =3D [0, 1].<br>On=
the other hand, it=E2=80=99s easy to verify that =F0=9D=91=A4 * =F0=9D=91=
=A4 * =F0=9D=91=A4 =3D =F0=9D=91=A4^3 always.<br>For this reason, given tha=
t currently the implementation of the MetaPost functions in MPFI mimics tho=
se of MPFR and they are not adapted to the interval arithmetic, the main ut=
ility of interval mode is the implementation of algorithms in MetaPost lang=
uage.<div><br>[14] Nathalie Revol and Fabrice Rouillier. Motivations for an=
arbitrary precision interval arithmetic<br>=C2=A0 =C2=A0 =C2=A0and the MPF=
I library. Reliab. Comput., 11(4):275=E2=80=93290, 2005.<br>""&qu=
ot;<br>See also<br><a href=3D"https://perso.ens-lyon.fr/nathalie.revol/soft=
ware.html">https://perso.ens-lyon.fr/nathalie.revol/software.html</a><br><a=
href=3D"https://www.reliable-computing.org/">https://www.reliable-computin=
g.org/</a><br><a href=3D"https://en.wikipedia.org/wiki/Interval_arithmetic"=
>https://en.wikipedia.org/wiki/Interval_arithmetic</a><br><br>--</div><div>=
luigi<br><div><br></div></div></div>
--0000000000007e81980611e00f86--
--===============2805541455177382471==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
http://tug.org/metapost/
--===============2805541455177382471==--