summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2024-02-20 17:59:51 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2024-02-20 17:59:51 +0000
commit996e522093d8edad414c575c4b0424b032b73651 (patch)
tree28a4e9e8695c8925596b16fa69fd1f6395372cec /Master/texmf-dist/doc/metapost
parentd6a703d839efcfd88bcc7096b2e5b2feecf11176 (diff)
Updated MetaPost mpman.pdf for the new interval arithmetic number system.
git-svn-id: svn://tug.org/texlive/trunk@70013 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost')
-rw-r--r--Master/texmf-dist/doc/metapost/base/mpman.pdfbin974807 -> 980209 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-numbersystems.tex26
-rw-r--r--Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-optab.tex3
-rw-r--r--Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-refman.tex5
-rw-r--r--Master/texmf-dist/doc/metapost/base/source-manual/mpman.bib17
-rw-r--r--Master/texmf-dist/doc/metapost/base/source-manual/mpman.tex5
6 files changed, 49 insertions, 7 deletions
diff --git a/Master/texmf-dist/doc/metapost/base/mpman.pdf b/Master/texmf-dist/doc/metapost/base/mpman.pdf
index dc123c23ba0..370b387f7d6 100644
--- a/Master/texmf-dist/doc/metapost/base/mpman.pdf
+++ b/Master/texmf-dist/doc/metapost/base/mpman.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-numbersystems.tex b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-numbersystems.tex
index 0e9dfaf09e8..7e82e29c873 100644
--- a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-numbersystems.tex
+++ b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-numbersystems.tex
@@ -1,10 +1,10 @@
\svnInfo $Id$
-\section{High-precision arithmetic with MetaPost}
+\section{High-precision and interval arithmetic with MetaPost}
\label{hparith}
In addition to the fixed-point arithmetics inherited from \MF, MetaPost
can also do higher-precision arithmetics. In total, MetaPost can handle
-numeric quantities in four internal representation formats or number
+numeric quantities in five internal representation formats or number
systems. Number systems differ in rounding errors\index{rounding error}
introduced by and the speed of arithmetic operations. Simply storing a
numeric value in a variable may already introduce a rounding error, so
@@ -14,7 +14,7 @@ The internal representation format used for numeric quantities can be
determined by a command-line switch
\texttt{-numbersystem}\index{command-line!mpost?\texttt{mpost}!-numbersystem?\texttt{-numbersystem}}
when invoking the MetaPost executable. Argument is a string and can be
-one of \texttt{scaled}, \texttt{double}, \texttt{binary}, or
+one of \texttt{scaled}, \texttt{double}, \texttt{binary}, \texttt{interval} or
\texttt{decimal}. The argument is stored in an internal string variable
\texttt{numbersystem}\index{numbersystem?\texttt{numbersystem}}\label{Dnumbersystem}.
Assigning a value to this variable at run-time triggers an error.
@@ -58,6 +58,26 @@ is an integer in the range $[-9,999,999; +9,999,999]$. All arithmetic
operations are done in software using the MPFR library~\cite{lib:mpfr}
and are usually orders of magnitude slower than in \texttt{double} mode.
+The \index{interval?interval number system}\texttt{interval} number
+system MPFI~\cite{lib:mpfi}, introduced in version \texttt{2.10}, is built on the top of the MPFR library
+and an interval quantity \texttt{[}\textit{number}\texttt{,}\textit{number}\texttt{]} is entered as
+\begin{center}\index{interval\_set?\texttt{interval\_set}}\label{Dintervalset}\texttt{w := interval\_set(}\textit{number}\texttt{,}\textit{number}\texttt{);}\end{center}
+An interval is a set, the left extrema being
+\begin{center}\index{interval\_get\_left\_endpoint?\texttt{interval\_get\_left\_endpoint}}\label{Dintervalleft}\texttt{l := interval\_get\_left\_endpoint(}\textit{interval}\texttt{);}\end{center}
+and the right extrema
+\begin{center}\index{interval\_get\_right\_endpoint?\texttt{interval\_get\_right\_endpoint}}\label{Dintervalright}\texttt{r := interval\_get\_right\_endpoint(}\textit{interval}\texttt{);}\end{center}
+and it's always $l\leq r$\,; a number \texttt{x} is always seen as the interval \texttt{[x,x]}, i.e. a set with one element.
+At first glance, interval arithmetic can be confusing: if $w$ is an interval,
+$w*w$ is the set $\left\{ x*x: x\in w\right\}$, but $f(w)=w^2$ is the set $\left\{f(x): x\in w\right\} = \left\{x^2: x\in w\right\}$:
+if $w=[-1,1]$ then $w*w=[-1,1]$ and $w^2=[0,1]$. On the other hand, it's easy to verify that $w*w*w = w^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.
+
+
+
+
+
Number system \texttt{decimal}\index{decimal?\texttt{decimal}} provides
arbitrary precision floating-point arithmetics similar to the
\texttt{binary} number system. Except that it uses a base of~10 for the
diff --git a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-optab.tex b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-optab.tex
index 5cb62e52390..bd4b2a6d727 100644
--- a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-optab.tex
+++ b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-optab.tex
@@ -79,6 +79,9 @@ hex\index{hex?\texttt{hex}}& --& string& numeric& --& Interpret as a hexade
infont\index{infont?\texttt{infont}}& string& string& picture& \pageref{Sinfont}& Typeset string in given font\\\hline
\pl intersec\-tionpoint\index{intersectionpoint?\texttt{intersectionpoint}}& path& path& pair& \pageref{Disecpt}& An intersection point\\\hline
intersec\-tiontimes\index{intersectiontimes?\texttt{intersectiontimes}}& path& path& pair& \pageref{Disectt}& Times ($t_l,t_r)$ on paths $l$ and $r$ when the paths intersect\\\hline
+interval\-\_get\-\_left\-\_endpoint\index{interval\_get\_left\_endpoint?\texttt{interval\_get\_left\_endpoint}} & --& numeric & numeric& \pageref{Dintervalleft}& The left endpoint of an interval quantity\\\hline
+interval\-\_get\-\_right\-\_endpoint\index{interval\_get\_right\_endpoint?\texttt{interval\_get\_right\_endpoint}}& --& numeric & numeric& \pageref{Dintervalright}& The right endpoint of an interval quantity\\\hline
+interval\-\_set\index{interval\_set?\texttt{interval\_set}}& --& pair & numeric& \pageref{Dintervalset}& Create an interval quantity\\\hline
\pl inverse\index{inverse?\texttt{inverse}}& --& transform& transform& \pageref{Dinv}& Invert a transformation\\\hline
known\index{known?\texttt{known}}& --& any& boolean& \pageref{Dknown}& Does argument have a known value?\\\hline
length\index{length?\texttt{length}}& --& path\par string\par picture& numeric& \pageref{Dlength}\par \pageref{DlengthString}\par \pageref{DlengthPicture}& Number of components (arcs, characters, strokes, \ldots) in the argument\\\hline
diff --git a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-refman.tex b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-refman.tex
index ad8b84bfb0e..266bc9d7226 100644
--- a/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-refman.tex
+++ b/Master/texmf-dist/doc/metapost/base/source-manual/mpman-app-refman.tex
@@ -558,7 +558,8 @@ $\tt \descr{unary op} \rightarrow \descr{type}$\\
$\tt \qquad \;|\; abs \;|\; angle \;|\; arclength \;|\; ASCII \;|\; bbox \;|\; blackpart \;|\; bluepart \;|\; bot \;|\; bounded$\\
$\tt \qquad \;|\; ceiling \;|\; center \;|\; char \;|\; clipped \;|\; colormodel \;|\; cosd \;|\; cyanpart \;|\; cycle$\\
$\tt \qquad \;|\; dashpart \;|\; decimal \;|\; dir \;|\; floor \;|\; filled \;|\; fontpart \;|\; fontsize$\\
-$\tt \qquad \;|\; greenpart \;|\; greypart \;|\; hex \;|\; inverse \;|\; known \;|\; length \;|\; lft \;|\; llcorner$\\
+$\tt \qquad \;|\; greenpart \;|\; greypart \;|\; hex \;|\; interval\_get\_left\_endpoint \;|\; interval\_get\_right\_endpoint$\\
+$\tt \qquad \;|\; interval\_set \;|\; inverse \;|\; known \;|\; length \;|\; lft \;|\; llcorner$\\
$\tt \qquad \;|\; lrcorner\;|\; magentapart \;|\; makepath \;|\; makepen \;|\; mexp \;|\; mlog \;|\; not \;|\; oct \;|\; odd$\\
$\tt \qquad \;|\; pathpart \;|\; penpart \;|\; readfrom \;|\; redpart \;|\; reverse \;|\; round \;|\; rt \;|\; sind \;|\; sqrt$\\
$\tt \qquad \;|\; stroked \;|\; textpart \;|\; textual \;|\; top \;|\; ulcorner$\\
@@ -939,7 +940,7 @@ Here's a summary of the command-line switches provided by mpost:
in the current directory or specified via a full path.\\
\cmdindex{-numbersystem}=\tdescr{string}
& Set arithmetic mode to one of \texttt{scaled}, \texttt{double},
- \texttt{binary}, \texttt{decimal}\\
+ \texttt{binary}, \texttt{decimal}, \texttt{interval}\\
\cmdindex{-progname}=\tdescr{string}
& Pretend to be the \tdescr{string} executable.\\
\cmdindex{-recorder}
diff --git a/Master/texmf-dist/doc/metapost/base/source-manual/mpman.bib b/Master/texmf-dist/doc/metapost/base/source-manual/mpman.bib
index 7f089f8ba71..378085678ca 100644
--- a/Master/texmf-dist/doc/metapost/base/source-manual/mpman.bib
+++ b/Master/texmf-dist/doc/metapost/base/source-manual/mpman.bib
@@ -128,6 +128,23 @@
significant slowdown with respect to other arbitrary-precision tools
--- and discuss a few applications where such a library can be useful.",
}
+@article{lib:mpfi,
+ author = {Nathalie Revol and
+ Fabrice Rouillier},
+ title = {Motivations for an Arbitrary Precision Interval Arithmetic and the
+ {MPFI} Library},
+ journal = {Reliab. Comput.},
+ volume = {11},
+ number = {4},
+ pages = {275--290},
+ year = {2005},
+ url = {https://doi.org/10.1007/s11155-005-6891-y},
+ doi = {10.1007/S11155-005-6891-Y},
+ timestamp = {Thu, 16 Apr 2020 11:28:20 +0200},
+ biburl = {https://dblp.org/rec/journals/rc/RevolR05.bib},
+ bibsource = {dblp computer science bibliography, https://dblp.org}
+}
+
@misc{lib:decnumber,
key = "decnumber",
title = "dec{N}umber {ANSI} {C} implementation of General Decimal Arithmetic",
diff --git a/Master/texmf-dist/doc/metapost/base/source-manual/mpman.tex b/Master/texmf-dist/doc/metapost/base/source-manual/mpman.tex
index 80c7ce8d0c9..990ccd75e29 100644
--- a/Master/texmf-dist/doc/metapost/base/source-manual/mpman.tex
+++ b/Master/texmf-dist/doc/metapost/base/source-manual/mpman.tex
@@ -14,7 +14,7 @@
\usepackage[nofancy]{svninfo}% Access VCS information.
\svnInfo $Id$
%\svnInfo $Id$
-\newcommand*{\mpversion}{2.00}
+\newcommand*{\mpversion}{2.10}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@@ -63,8 +63,9 @@
\usepackage{multicol}
\usepackage[rgb,x11names]{xcolor}% Optimize for screen reading.
-\usepackage{hyperxmp}
\usepackage{hyperref}
+\usepackage{hyperxmp}
+%%\usepackage{hyperref}
\hypersetup{
pdftitle={MetaPost: A User's Manual},
pdfauthor={John D. Hobby and the MetaPost development team},