diff options
Diffstat (limited to 'systems/doc/metapost')
-rw-r--r-- | systems/doc/metapost/NEWS (renamed from systems/doc/metapost/CHANGES) | 9 | ||||
-rw-r--r-- | systems/doc/metapost/mpman.pdf | bin | 974807 -> 980209 bytes | |||
-rw-r--r-- | systems/doc/metapost/source-manual/mpman-app-numbersystems.tex | 26 | ||||
-rw-r--r-- | systems/doc/metapost/source-manual/mpman-app-optab.tex | 3 | ||||
-rw-r--r-- | systems/doc/metapost/source-manual/mpman-app-refman.tex | 5 | ||||
-rw-r--r-- | systems/doc/metapost/source-manual/mpman.bib | 17 | ||||
-rw-r--r-- | systems/doc/metapost/source-manual/mpman.tex | 5 |
7 files changed, 58 insertions, 7 deletions
diff --git a/systems/doc/metapost/CHANGES b/systems/doc/metapost/NEWS index 05faf13051..32606d23b0 100644 --- a/systems/doc/metapost/CHANGES +++ b/systems/doc/metapost/NEWS @@ -1,6 +1,15 @@ This file is public domain. +---------------------------------------------------------------------- +What is new in MetaPost version 2.10: +---------------------------------------------------------------------- +* New interval number system based on MPFI. The implementation is somewhat experimental, + given the "unusual" nature of interval arithmetic. + The internal functions are almost verbatim copies of the MPFR-based binary system + (on which MPFI is based). +* Several bugs fixes. + ---------------------------------------------------------------------- What is new in MetaPost version 2.01: diff --git a/systems/doc/metapost/mpman.pdf b/systems/doc/metapost/mpman.pdf Binary files differindex dc123c23ba..370b387f7d 100644 --- a/systems/doc/metapost/mpman.pdf +++ b/systems/doc/metapost/mpman.pdf diff --git a/systems/doc/metapost/source-manual/mpman-app-numbersystems.tex b/systems/doc/metapost/source-manual/mpman-app-numbersystems.tex index 0e9dfaf09e..7e82e29c87 100644 --- a/systems/doc/metapost/source-manual/mpman-app-numbersystems.tex +++ b/systems/doc/metapost/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/systems/doc/metapost/source-manual/mpman-app-optab.tex b/systems/doc/metapost/source-manual/mpman-app-optab.tex index 5cb62e5239..bd4b2a6d72 100644 --- a/systems/doc/metapost/source-manual/mpman-app-optab.tex +++ b/systems/doc/metapost/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/systems/doc/metapost/source-manual/mpman-app-refman.tex b/systems/doc/metapost/source-manual/mpman-app-refman.tex index ad8b84bfb0..266bc9d722 100644 --- a/systems/doc/metapost/source-manual/mpman-app-refman.tex +++ b/systems/doc/metapost/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/systems/doc/metapost/source-manual/mpman.bib b/systems/doc/metapost/source-manual/mpman.bib index 7f089f8ba7..378085678c 100644 --- a/systems/doc/metapost/source-manual/mpman.bib +++ b/systems/doc/metapost/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/systems/doc/metapost/source-manual/mpman.tex b/systems/doc/metapost/source-manual/mpman.tex index 80c7ce8d0c..990ccd75e2 100644 --- a/systems/doc/metapost/source-manual/mpman.tex +++ b/systems/doc/metapost/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}, |