[metapost] Metapost 2.1 and interval arithmetic

luigi scarso luigi.scarso at gmail.com
Wed Feb 21 09:24:39 CET 2024


   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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20240221/ba55fa8d/attachment.htm>


More information about the metapost mailing list.