summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-13 03:00:56 +0000
committerNorbert Preining <norbert@preining.info>2021-04-13 03:00:56 +0000
commit32940266507ccd0c4ba129c61e8932734370e283 (patch)
treeb26a8b13953b035ea6e12d2d46ad0488c9636d06 /macros/generic
parent72c29070e5c574da1a734cb90214754b2f3aa698 (diff)
CTAN sync 202104130300
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/expkv-cs/README.md4
-rw-r--r--macros/generic/expkv-cs/expkv-cs.dtx455
-rw-r--r--macros/generic/expkv-cs/expkv-cs.pdfbin321681 -> 346046 bytes
-rw-r--r--macros/generic/expkv/README.md2
-rw-r--r--macros/generic/expkv/expkv.dtx11
-rw-r--r--macros/generic/expkv/expkv.pdfbin444730 -> 444584 bytes
-rw-r--r--macros/generic/polexpr/README.md4
-rw-r--r--macros/generic/polexpr/polexpr.html2031
-rw-r--r--macros/generic/polexpr/polexpr.sty29
-rw-r--r--macros/generic/polexpr/polexprcore.tex81
-rw-r--r--macros/generic/polexpr/polexprexpr.tex12
-rw-r--r--macros/generic/polexpr/polexprsturm.tex27
12 files changed, 1595 insertions, 1061 deletions
diff --git a/macros/generic/expkv-cs/README.md b/macros/generic/expkv-cs/README.md
index 704f877adf..5b56601a5d 100644
--- a/macros/generic/expkv-cs/README.md
+++ b/macros/generic/expkv-cs/README.md
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# expkv-cs -- define expandable key=val macros using expkv
-Version 2020-10-18 v0.6
+Version 2021-04-12 v0.8
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
@@ -10,7 +10,7 @@ Hosted at https://github.com/Skillmon/tex_expkv-cs
-------------------------------------------------------------------------------
-Copyright (C) 2020 Jonathan P. Spratte
+Copyright (C) 2020-2021 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/macros/generic/expkv-cs/expkv-cs.dtx b/macros/generic/expkv-cs/expkv-cs.dtx
index 7dd4c6aad6..5847a4980b 100644
--- a/macros/generic/expkv-cs/expkv-cs.dtx
+++ b/macros/generic/expkv-cs/expkv-cs.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-cs.dtx Copyright (C) 2020 Jonathan P. Spratte
+% File: expkv-cs.dtx Copyright (C) 2020-2021 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -27,7 +27,7 @@ Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
--------------------------------------------------------------
-Copyright (C) 2020 Jonathan P. Spratte
+Copyright (C) 2020-2021 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -164,7 +164,7 @@ and the derived files expkv-cs.pdf
}
\hypersetup{linkcolor=red!80!black,urlcolor=purple!80!black}
\DoNotIndex{\def,\edef,\,,\=,\begingroup,\catcode,\chardef,\csname,\endcsname}
-\DoNotIndex{\endgroup,\endinput,\errmessage,\expandafter,\input,\let,\long}
+\DoNotIndex{\endgroup,\endinput,\errmessage,\expandafter,\input,\let,\long,\z@}
\DoNotIndex{\protected,\ProvidesFile,\ProvidesPackage,\relax,\space,\advance}
\DoNotIndex{\@,\unexpanded,\string,\expanded,\dimexpr,\global,\glueexpr,\hbox}
\DoNotIndex{\numexpr,\RequirePackage,\setbox,\the,\unless,\xdef,\gdef,\newcount}
@@ -529,6 +529,151 @@ and the derived files expkv-cs.pdf
% secondary key.
% \end{function}
%
+% \begin{function}{flag-bool}
+% \begin{syntax}
+% flag-bool \key\ = \meta{cs} \prefixes3
+% \end{syntax}
+% This is a secondary key that doesn't directly involve any of the primary or
+% secondary keys.
+% This defines \key\ to take a value, which should be either |true| or
+% |false|, and set the flag called \meta{cs} accordingly as a boolean.
+% If \meta{cs} isn't defined yet it will be initialised as a flag.
+% Please also read \autoref{sec:flags}.
+% \end{function}
+%
+% \begin{function}{flag-true,flag-false}
+% \begin{syntax}
+% flag-true \key\ = \meta{cs} \prefixes3
+% \end{syntax}
+% This is a secondary key that doesn't directly involve any of the primary or
+% secondary keys.
+% This defines \key\ to take no value and set the flag called \meta{cs} to
+% |true| or |false|, respectively.
+% If \meta{cs} isn't defined yet it will be initialised as a flag.
+% Please also read \autoref{sec:flags}.
+% \end{function}
+%
+% \begin{function}{flag-raise}
+% \begin{syntax}
+% flag-raise \key\ = \meta{cs} \prefixes3
+% \end{syntax}
+% This is a secondary key that doesn't directly involve any of the primary or
+% secondary keys.
+% This defines \key\ to take no value and raise the flag called \meta{cs}.
+% If \meta{cs} isn't defined yet it will be initialised as a flag.
+% Please also read \autoref{sec:flags}.
+% \end{function}
+%
+%
+% \subsection{Flags}\label{sec:flags}
+%
+% The idea of flags is taken from \pkg{expl3}. They provide a way to store
+% numerical information expandably, however only incrementing and accessing
+% works expandably, decrementing is unexpandable. A flag has a height, which
+% is a numerical value, and which can be raised by $1$. Flags come at a high
+% computational cost (accessing them is slow and they require more memory than
+% normal \TeX\ data types like registers, both getting linearly worse with the
+% height), so don't use them if not necessary.
+%
+% The state of flags is always changed locally to the current group, but not to
+% the current macro, so if you're using one of the |t|-types involving flags
+% bear in mind that they can affect other macros at the current group level!
+%
+% \expkvc\ provides some macros to access, alter, and use flags. Flags of
+% \expkvc\ don't share a name space with the flags of \pkg{expl3}.
+%
+% \begin{function}{\ekvcFlagNew}
+% \begin{syntax}
+% \cs{ekvcFlagNew}\meta{flag}
+% \end{syntax}
+% This initialises the macro \meta{flag} as a new flag. It isn't checked
+% whether the macro \meta{flag} is currently undefined. A \meta{flag} will
+% expand to the flag's current height with a trailing space (so you can use it
+% directly with |\ifnum| for example and it will terminate the number scanning
+% itself).
+% \end{function}
+%
+% All other macros dealing with flags take as a parameter a macro defined as a
+% \meta{flag} with |\ekvcFlagNew|.
+%
+% \begin{function}{\ekvcFlagHeight}
+% \begin{syntax}
+% \cs{ekvcFlagHeight}\meta{flag}
+% \end{syntax}
+% This expands to the current height of \meta{flag} in a single step of
+% expansion (without a trailing space).
+% \end{function}
+%
+% \begin{function}{\ekvcFlagRaise}
+% \begin{syntax}
+% \cs{ekvcFlagRaise}\meta{flag}
+% \end{syntax}
+% This expandably raises the height of \meta{flag} by $1$.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagSetTrue,\ekvcFlagSetFalse}
+% \begin{syntax}
+% \cs{ekvcFlagSetTrue}\meta{flag}
+% \end{syntax}
+% By interpreting an even value as false and an odd value as true we can use a
+% flag as a boolean. This expandably sets \meta{flag} to true or false,
+% respectively, by raising it if necessary.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagIf}
+% \begin{syntax}
+% \cs{ekvcFlagIf}\meta{flag}\marg{true}\marg{false}
+% \end{syntax}
+% This interprets a \meta{flag} as a boolean and expands to either \meta{true}
+% or \meta{false}.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagIfRaised}
+% \begin{syntax}
+% \cs{ekvcFlagIfRaised}\meta{flag}\marg{true}\marg{false}
+% \end{syntax}
+% This tests whether the \meta{flag} is raised, meaning it has a height
+% greater than zero, and if so expands to \meta{true} else to \meta{false}.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagReset}
+% \begin{syntax}
+% \cs{ekvcFlagReset}\meta{flag}
+% \end{syntax}
+% This resets a flag (so restores its height to $0$). This operation is
+% \emph{not} expandable and done locally. If you really intend to use flags
+% you can reset them every now and then to keep the performance hit low.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagGetHeight}
+% \begin{syntax}
+% \cs{ekvcFlagGetHeight}\meta{flag}\marg{next}
+% \end{syntax}
+% This retrieves the current height of the \meta{flag} and provides it as a
+% braced argument to \meta{next}, leaving \meta{next}\marg{height} in the
+% input stream.
+% \end{function}
+%
+% \begin{function}{\ekvcFlagGetHeights}
+% \begin{syntax}
+% \cs{ekvcFlagGetHeights}\marg{flag-list}\marg{next}
+% \end{syntax}
+% This retrieves the current height of each \meta{flag} in the
+% \meta{flag-list} and provides them as a single argument to \meta{next}.
+% Inside that argument each height is enclosed in a set of braces
+% individually. The \meta{flag-list} is just a single argument containing the
+% \meta{flag}s.
+% So a usage like
+% \texttt
+% {^^A
+% \cs[no-index]{ekvcFlagGetHeights}\hskip0pt^^A
+% \{\cs[no-index]{myflagA}\cs[no-index]{myflagB}\}\hskip0pt^^A
+% \{\cs[no-index]{stuff}\}^^A
+% }
+% will expand to
+% \texttt{\cs[no-index]{stuff}\{\marg{height-A}\marg{height-B}\}}.
+% \end{function}
+%
%
% \subsection{Example}
%
@@ -692,7 +837,7 @@ and the derived files expkv-cs.pdf
% Just in case you're wondering now, a simple macro taking seven arguments is
% $30$ to $40$ times faster than any of those in the argument grabbing and \kv\
% parsing part and only $1.5$ to $2.8$ times faster if the typesetting part is
-% factored in. So the real choke isn't the parsing.
+% factored in. So the real choke isn't the parsing.
%
% So to summarize this, if you have a reasonable use case for expandable \kv\
% parsing macros you should go on and define them using \expkvc. If you have a
@@ -800,8 +945,8 @@ and the derived files expkv-cs.pdf
% \begin{macro}{\ekvcVersion,\ekvcDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvcVersion{0.6}
-\def\ekvcDate{2020-10-18}
+\def\ekvcVersion{0.8}
+\def\ekvcDate{2021-04-12}
% \end{macrocode}
% \end{macro}
%
@@ -824,17 +969,16 @@ and the derived files expkv-cs.pdf
% \begin{macro}[internal]{\ekvc@zero}
% There are different ways to define a |\romannumeral| expansion. If the
% control is never given to user input, the fastest way is to just execute
-% your code and use a |\chardef|ed zero to end it afterwards. If the control
+% your code and use a |\dimendef|ed zero to end it afterwards. If the control
% is given to user input (so user input should be expanded) the fastest and
% best way is to use |\romannumeral`\^^@|, this will expand the user input
% until something unexpandable is found or a space (which would then be
% gobbled). However, we want to use the former approach since we don't want to
% expand any user input, just make sure own code is expanded in two steps.
-% Since we want to use the |\chardef| variant, we have to actually provide
-% such a token.
-% \begin{macrocode}
-\chardef\ekvc@zero0
-% \end{macrocode}
+% Since we want to use the |\dimendef| variant, we have to actually provide
+% such a token. Since both plain \TeX\ and \LaTeX\ define |\z@| we can use
+% that (but we use a private name for it). Luckily, \expkv\ already contains
+% |\ekv@zero|, which we can use in \expkvc.
% \end{macro}
%
% \begin{macro}[internal]{\ekvc@keycount}
@@ -856,9 +1000,9 @@ and the derived files expkv-cs.pdf
%
% \begin{macro}[internal]
% {
-% \ekvc@ekvset@per@expander,
-% \ekvc@ekvset@per@expander@a,
-% \ekvc@ekvset@per@expander@b
+% \ekvc@ekvset@pre@expander,
+% \ekvc@ekvset@pre@expander@a,
+% \ekvc@ekvset@pre@expander@b
% }
% This macro expands |\ekvset| twice so that the first two steps of expansion
% don't have to be made every time the \expkvc\ macros are used. We have to do
@@ -1394,10 +1538,10 @@ and the derived files expkv-cs.pdf
####1%
{%
\unexpanded\expandafter{\csname ekvc@@safehash@#1\endcsname}%
- ####1\unexpanded{\ekvc@mark\ekvc@zero}%
+ ####1\unexpanded{\ekvc@mark\ekv@zero}%
\unexpanded\expandafter
{%
- \csname ekvc@hashmark@#1\endcsname\ekvc@zero
+ \csname ekvc@hashmark@#1\endcsname\ekv@zero
\ekvc@mark{\ekvc@err@missing@hash{#1}}\ekvc@stop
}%
}%
@@ -1458,7 +1602,7 @@ and the derived files expkv-cs.pdf
\romannumeral
\ekv@ifdefined{ekvc@safehash@#1}%
{\csname ekvc@safehash@#1\endcsname}%
- {\ekvc@err@unknown@hash{#1}\@firstoftwo\ekvc@zero}%
+ {\ekvc@err@unknown@hash{#1}\@firstoftwo\ekv@zero}%
}
% \end{macrocode}
% \end{macro}
@@ -1524,7 +1668,7 @@ and the derived files expkv-cs.pdf
% thrown by |\ekvcValueFast| in three expansion steps. The safe hash variant
% has to also stop the |\romannumeral| expansion.
% \begin{macrocode}
-\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash\ekvc@zero}
+\long\def\ekvc@safehash@#1{\ekvc@err@empty@hash\ekv@zero}
\long\def\ekvc@fasthash@#1\ekvc@stop{\ekvc@err@empty@hash}
\long\def\ekvc@safesplithash@#1#2{\ekvc@err@empty@hash#2{#1}{}}
\long\def\ekvc@fastsplithash@#1\ekvc@stop#2{\ekvc@err@empty@hash#2{#1}{}}
@@ -1668,6 +1812,258 @@ and the derived files expkv-cs.pdf
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[internal]{\ekvc@t@flag-bool}
+% \begin{macrocode}
+\protected\expandafter\def\csname ekvc@t@flag-bool\endcsname#1#2%
+ {%
+ \ekvc@assert@not@long{flag-bool #1}%
+ \unless\ifdefined#2\ekvcFlagNew#2\fi
+ \ekvdef\ekvc@set{#1}%
+ {%
+ \ekv@ifdefined{ekvc@flag@set@##1}%
+ {%
+ \csname ekvc@flag@set@##1\expandafter\endcsname
+ \ekvcFlagHeight#2\ekv@stop#2%
+ }%
+ {\ekvc@err@invalid@bool{##1}}%
+ }%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+% {\ekvc@t@flag-true,\ekvc@t@flag-false,\ekvc@t@flag-raise,\ekvc@type@flag}
+% \begin{macrocode}
+\protected\def\ekvc@type@flag#1#2#3#4%
+ {%
+ \ekvc@assert@not@long{flag-#1 #3}%
+ \unless\ifdefined#4\ekvcFlagNew#4\fi
+ \ekv@exparg{\ekvdefNoVal\ekvc@set{#3}}{#2#4}%
+ }
+\protected\expandafter\def\csname ekvc@t@flag-true\endcsname
+ {\ekvc@type@flag{true}\ekvcFlagSetTrue}
+\protected\expandafter\def\csname ekvc@t@flag-false\endcsname
+ {\ekvc@type@flag{false}\ekvcFlagSetFalse}
+\protected\expandafter\def\csname ekvc@t@flag-raise\endcsname
+ {\ekvc@type@flag{raise}\ekvcFlagRaise}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Flags}
+%
+% The basic idea of flags is to store information by the fact that \TeX\
+% expandably assigns the meaning |\relax| to undefined control sequences which
+% were built with |\csname|. This mechanism is borrowed from \pkg{expl3}.
+%
+% \begin{macro}[internal]{\ekvc@flag@name,\ekvc@flag@namescheme}
+% Flags follow a simple naming scheme which we define here. |\ekvc@flag@name|
+% will store the name of an internal function that is used to build names of
+% the second naming scheme defined by |\ekvc@flag@namescheme|.
+% \begin{macrocode}
+\def\ekvc@flag@name{ekvcf\string}
+\def\ekvc@flag@namescheme#1#2{ekvch#2#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagHeight}
+% For semantic reasons we use |\number| with another name.
+% \begin{macrocode}
+\let\ekvcFlagHeight\number
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagNew}
+% This macro defines a new flag. It stores the function build with the
+% |\ekvc@flag@name| naming scheme after the internal function
+% |\ekvc@flag@height| that'll determine the current flag height. It'll also
+% define the macro named via |\ekvc@flag@name| to build names according to
+% |\ekvc@flag@namescheme|.
+% \begin{macrocode}
+\protected\def\ekvcFlagNew#1%
+ {%
+ \edef#1%
+ {%
+ \unexpanded{\ekvc@flag@height}%
+ \unexpanded\expandafter{\csname\ekvc@flag@name#1\endcsname}%
+ }%
+ \ekv@expargtwice
+ {\expandafter\def\csname\ekvc@flag@name#1\endcsname##1}%
+ {\expandafter\ekvc@flag@namescheme\expandafter{\string#1}{##1}}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvc@flag@height,\ekvc@flag@height@}
+% This macro gets the height of a flag by a simple loop. The first loop
+% iteration differs a bit from the following in that it doesn't have to get
+% the current iteration count. The space at the end of |\ekvc@flag@height|
+% ends the |\number| evaluation.
+% \begin{macrocode}
+\def\ekvc@flag@height#1%
+ {%
+ \ifcsname#10\endcsname
+ \ekvc@flag@height@1\ekv@stop#1%
+ \fi
+ \@firstofone{0} % leave this space
+ }
+\def\ekvc@flag@height@#1\ekv@stop#2\fi\@firstofone#3%
+ {%
+ \fi
+ \ifcsname#2{#1}\endcsname
+ \expandafter\ekvc@flag@height@\the\numexpr#1+1\relax\ekv@stop#2%
+ \fi
+ \@firstofone{#1}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagRaise}
+% Raising a flag simply means letting the |\ekvc@flag@namescheme| macro for
+% the current height to relax. The result of raising a flag is that its height
+% is bigger by $1$.
+% \begin{macrocode}
+\ekv@exparg{\def\ekvcFlagRaise#1}%
+ {%
+ \expandafter\expandafter\expandafter\@gobble\expandafter
+ \csname\ekvc@flag@namescheme{\string#1}{\ekvcFlagHeight#1}\endcsname
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagSetTrue,\ekvcFlagSetFalse}
+% \begin{macro}[internal]{\ekvc@flag@set@true,\ekvc@flag@set@false}
+% A flag is considered true if its current height is odd, and as false if it
+% is even. Therefore |\ekvcFlagSetTrue| and |\ekvcFlagSetFalse| only need to
+% raise the flag if the opposing boolean value is the current one.
+% \begin{macrocode}
+\def\ekvcFlagSetTrue#1%
+ {\expandafter\ekvc@flag@set@true\ekvcFlagHeight#1\ekv@stop#1}
+\def\ekvcFlagSetFalse#1%
+ {\expandafter\ekvc@flag@set@false\ekvcFlagHeight#1\ekv@stop#1}
+% \end{macrocode}
+% We can expand |\ekvc@flag@namescheme| at definition time here, which is why
+% we're using a temporary definition to set up |\ekvc@flag@set@true| and
+% |\ekvc@flag@set@false|.
+% \begin{macrocode}
+\def\ekvc@flag@set@true#1%
+ {%
+ \def\ekvc@flag@set@true##1\ekv@stop##2%
+ {%
+ \ifodd##1
+ \ekv@fi@gobble
+ \fi
+ \@firstofone{\expandafter\@gobble\csname#1\endcsname}%
+ }%
+ \def\ekvc@flag@set@false##1\ekv@stop##2%
+ {%
+ \ifodd##1
+ \ekv@fi@firstofone
+ \fi
+ \@gobble{\expandafter\@gobble\csname#1\endcsname}%
+ }%
+ }
+\expandafter\ekvc@flag@set@true\expandafter
+ {\ekvc@flag@namescheme{\string#2}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagIf}
+% As already explained, truthiness is defined as a flag's height is odd, so we
+% just branch accordingly here.
+% \begin{macrocode}
+\def\ekvcFlagIf#1%
+ {%
+ \ifodd#1%
+ \ekv@fi@firstoftwo
+ \fi
+ \@secondoftwo
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagIfRaised}
+% This macro uses flags as a switch, if a flag's current height is bigger than
+% $0$ this test yields true.
+% \begin{macrocode}
+\ekv@exparg{\def\ekvcFlagIfRaised#1}%
+ {%
+ \expandafter\ifcsname\ekvc@flag@namescheme{\string#1}0\endcsname
+ \ekv@fi@firstoftwo
+ \fi
+ \@secondoftwo
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagReset}
+% \begin{macro}[internal]{\ekvc@flag@reset,\ekvc@flag@reset@}
+% Resetting works by locally letting all the defined internal macros named
+% after |\ekvc@flag@namescheme| to undefined.
+% \begin{macrocode}
+\protected\def\ekvcFlagReset#1%
+ {\expandafter\ekvc@flag@reset\csname\ekvc@flag@name#1\endcsname}
+\protected\def\ekvc@flag@reset#1%
+ {%
+ \ifcsname#10\endcsname
+ \expandafter\let\csname#10\endcsname\ekvc@undefined
+ \ekvc@flag@reset@1\ekv@stop#1%
+ \fi
+ }
+\protected\def\ekvc@flag@reset@#1\ekv@stop#2\fi
+ {%
+ \fi
+ \ifcsname#2{#1}\endcsname
+ \expandafter\let\csname#2{#1}\endcsname\ekvc@undefined
+ \expandafter\ekvc@flag@reset@\the\numexpr#1+1\relax\ekv@stop#2%
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagGetHeight}
+% \begin{macro}[internal]{\ekvc@flag@get@height@single}
+% These are just small helpers, first getting the height of the flag and then
+% passing it on to the user supplied code.
+% \begin{macrocode}
+\def\ekvcFlagGetHeight#1%
+ {\expandafter\ekvc@flag@get@height@single\ekvcFlagHeight#1\ekv@stop}
+\long\def\ekvc@flag@get@height@single#1\ekv@stop#2{#2{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ekvcFlagGetHeights}
+% \begin{macro}[internal]
+% {\ekvc@flag@get@heights,\ekvc@flag@get@heights@,\ekvc@flag@get@heights@done}
+% This works by a simple loop that stops at |\ekv@stop|. As long as that
+% marker isn't hit, get the next flags height and put it into a list after
+% |\ekv@stop|. |\ekvc@flag@get@heights@| uses the same marker name for the
+% end of the height, which shouldn't clash in any case. Once we're done we
+% remove the remainder of the current iteration and leave the user supplied
+% code in the input stream with all the flags' heights as a single argument.
+% \begin{macrocode}
+\def\ekvcFlagGetHeights#1%
+ {%
+ \ekvc@flag@get@heights#1\ekv@stop{}%
+ }
+\def\ekvc@flag@get@heights#1%
+ {%
+ \ekv@gobbleto@stop#1\ekvc@flag@get@heights@done\ekv@stop
+ \expandafter\ekvc@flag@get@heights@\ekvcFlagHeight#1\ekv@stop
+ }
+\def\ekvc@flag@get@heights@#1\ekv@stop#2\ekv@stop#3%
+ {\ekvc@flag@get@heights#2\ekv@stop{#3{#1}}}
+\long\def\ekvc@flag@get@heights@done
+ \ekv@stop
+ \expandafter\ekvc@flag@get@heights@\ekvcFlagHeight\ekv@stop\ekv@stop#1#2%
+ {#2{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
%
% \subsubsection{Helper Macros}
%
@@ -1744,29 +2140,26 @@ and the derived files expkv-cs.pdf
% \begin{macro}[internal]{\ekvc@err,\ekvc@err@}
% We need a way to throw error messages expandably in some contexts.
% \begin{macrocode}
-\begingroup
-\edef\ekvc@err
+\def\ekvc@err#1%
{%
- \endgroup
- \unexpanded{\long\def\ekvc@err}##1%
- {%
- \unexpanded{\expandafter\ekvc@err@\@firstofone}%
- {\unexpanded\expandafter{\csname ! expkv-cs Error:\endcsname}##1.}%
- \unexpanded{\ekv@stop}%
- }%
+ \long\def\ekvc@err##1{\expandafter\ekv@err@\@firstofone{#1##1.}\ekv@stop}%
}
-\ekvc@err
-\def\ekvc@err@{\expandafter\ekv@gobbleto@stop}
+\begingroup\expandafter\endgroup
+\expandafter\ekvc@err\csname ! expkv-cs Error:\endcsname
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[internal]
-% {\ekvc@err@unknown@hash,\ekvc@err@empty@hash,\ekvc@err@missing@hash}
+% {
+% \ekvc@err@unknown@hash,\ekvc@err@empty@hash,\ekvc@err@missing@hash,
+% \ekvc@err@invalid@bool
+% }
% And here are the expandable error messages.
% \begin{macrocode}
\long\def\ekvc@err@unknown@hash#1{\ekvc@err{unknown hash `#1'}}
\long\def\ekvc@err@missing@hash#1{\ekvc@err{hash `#1' not found}}
\long\def\ekvc@err@empty@hash{\ekvc@err{empty hash}}
+\def\ekvc@err@invalid@bool#1{\ekvc@err{invalid boolean value `#1'}}
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/generic/expkv-cs/expkv-cs.pdf b/macros/generic/expkv-cs/expkv-cs.pdf
index d8b76f5514..f498bcb298 100644
--- a/macros/generic/expkv-cs/expkv-cs.pdf
+++ b/macros/generic/expkv-cs/expkv-cs.pdf
Binary files differ
diff --git a/macros/generic/expkv/README.md b/macros/generic/expkv/README.md
index 7a696a1f7f..512cd829ca 100644
--- a/macros/generic/expkv/README.md
+++ b/macros/generic/expkv/README.md
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# expkv -- an expandable key=val implementation
-Version 2021-04-09 v1.7
+Version 2021-04-11 v1.7a
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
diff --git a/macros/generic/expkv/expkv.dtx b/macros/generic/expkv/expkv.dtx
index 49af99c01d..553065f32b 100644
--- a/macros/generic/expkv/expkv.dtx
+++ b/macros/generic/expkv/expkv.dtx
@@ -1325,8 +1325,8 @@ and the derived files expkv.pdf
% \begin{macro}{\ekvVersion,\ekvDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvVersion{1.7}
-\def\ekvDate{2021-04-09}
+\def\ekvVersion{1.7a}
+\def\ekvDate{2021-04-11}
% \end{macrocode}
% \end{macro}
%
@@ -1380,8 +1380,8 @@ and the derived files expkv.pdf
% \begin{macro}[internal]
% {
% \@gobble,\@firstofone,\@firstoftwo,\@secondoftwo,
-% \ekv@gobbleto@stop,\ekv@fi@gobble,\ekv@fi@firstoftwo,\ekv@fi@secondoftwo,
-% \ekv@gobble@mark,\ekv@gobble@from@mark@to@stop
+% \ekv@fi@gobble,\ekv@fi@firstofone,\ekv@fi@firstoftwo,\ekv@fi@secondoftwo,
+% \ekv@gobble@mark,\ekv@gobbleto@stop,\ekv@gobble@from@mark@to@stop
% }
% Since branching tests are often more versatile than |\if...\else...\fi|
% constructs, we define helpers that are branching pretty fast. Also here are
@@ -1396,10 +1396,11 @@ and the derived files expkv.pdf
\long\def\@firstoftwo#1#2{#1}
\long\def\@secondoftwo#1#2{#2}
\long\def\ekv@fi@gobble\fi\@firstofone#1{\fi}
+\long\def\ekv@fi@firstofone\fi\@gobble#1{\fi#1}
\long\def\ekv@fi@firstoftwo\fi\@secondoftwo#1#2{\fi#1}
\long\def\ekv@fi@secondoftwo\fi\@firstoftwo#1#2{\fi#2}
-\long\def\ekv@gobbleto@stop#1\ekv@stop{}
\def\ekv@gobble@mark\ekv@mark{}
+\long\def\ekv@gobbleto@stop#1\ekv@stop{}
\long\def\ekv@gobble@from@mark@to@stop\ekv@mark#1\ekv@stop{}
% \end{macrocode}
% \end{macro}
diff --git a/macros/generic/expkv/expkv.pdf b/macros/generic/expkv/expkv.pdf
index 8cedc0f0e5..95b8d60b57 100644
--- a/macros/generic/expkv/expkv.pdf
+++ b/macros/generic/expkv/expkv.pdf
Binary files differ
diff --git a/macros/generic/polexpr/README.md b/macros/generic/polexpr/README.md
index b32b8f056d..1ea68b2df7 100644
--- a/macros/generic/polexpr/README.md
+++ b/macros/generic/polexpr/README.md
@@ -83,8 +83,10 @@ Releases
- 0.8 (2021/03/29)
Complete refactoring of the package core for better integration with
and enhancement of xintexpr 1.4.
+- 0.8.1 (2021/04/12)
+ Bugfix: a typo broke the 0.8 ``diff1()`` and related functions.
-Files of 0.8 release:
+Files of 0.8.1 release:
- polexpr.sty, polexprcore.tex, polexprexpr.tex, polexprsturm.tex,
- README.md,
diff --git a/macros/generic/polexpr/polexpr.html b/macros/generic/polexpr/polexpr.html
index 81cd2b4b7c..6b9881daef 100644
--- a/macros/generic/polexpr/polexpr.html
+++ b/macros/generic/polexpr/polexpr.html
@@ -598,222 +598,230 @@ a { text-decoration: none; }
<body>
<div class="document" id="package-polexpr-documentation">
<h1 class="title">Package polexpr documentation</h1>
-<p class="subtitle" id="id1">0.8 (2021/03/29)</p>
+<p class="subtitle" id="id1">0.8.1 (2021/04/12)</p>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
-<li><p><a class="reference internal" href="#usage" id="id41">Usage</a></p></li>
-<li><p><a class="reference internal" href="#abstract" id="id42">Abstract</a></p></li>
-<li><p><a class="reference internal" href="#prerequisites" id="id43">Prerequisites</a></p></li>
-<li><p><a class="reference internal" href="#quick-syntax-overview" id="id44">Quick syntax overview</a></p></li>
-<li><p><a class="reference internal" href="#the-polexpr-0-8-extensions-to-the-xintexpr-syntax" id="id45">The polexpr <span class="docutils literal">0.8</span> extensions to the <span class="docutils literal">\xintexpr</span> syntax</a></p>
+<li><p><a class="reference internal" href="#usage" id="id35">Usage</a></p></li>
+<li><p><a class="reference internal" href="#abstract" id="id36">Abstract</a></p></li>
+<li><p><a class="reference internal" href="#prerequisites" id="id37">Prerequisites</a></p></li>
+<li><p><a class="reference internal" href="#quick-syntax-overview" id="id38">Quick syntax overview</a></p></li>
+<li><p><a class="reference internal" href="#the-polexpr-0-8-extensions-to-the-xintexpr-syntax" id="id39">The polexpr <span class="docutils literal">0.8</span> extensions to the <span class="docutils literal">\xintexpr</span> syntax</a></p>
<ul>
-<li><p><a class="reference internal" href="#warning-about-unstability-of-the-new-syntax" id="id46">Warning about unstability of the new syntax</a></p></li>
-<li><p><a class="reference internal" href="#infix-operators" id="id47">Infix operators <span class="docutils literal">+, <span class="pre">-,</span> *, /, **, ^</span></a></p></li>
-<li><p><a class="reference internal" href="#experimental-infix-operators" id="id48">Experimental infix operators <span class="docutils literal">//, /:</span></a></p></li>
-<li><p><a class="reference internal" href="#comparison-operators" id="id49">Comparison operators <span class="docutils literal">&lt;, &gt;, &lt;=, &gt;=, ==, !=</span></a></p></li>
-<li><p><a class="reference internal" href="#pol-nutple-expression" id="id50"><span class="docutils literal"><span class="pre">pol(&lt;nutple</span> expression&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#xinteval-pol-expr" id="id51"><span class="docutils literal"><span class="pre">\xinteval{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#evalp-pol-expr-pol-expr" id="id52"><span class="docutils literal"><span class="pre">evalp(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. expr&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#deg-pol-expr" id="id53"><span class="docutils literal"><span class="pre">deg(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#coeffs-pol-expr" id="id54"><span class="docutils literal"><span class="pre">coeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#coeff-pol-expr-num-expr" id="id55"><span class="docutils literal"><span class="pre">coeff(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;num. <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#lcoeff-pol-expr" id="id56"><span class="docutils literal"><span class="pre">lcoeff(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#monicpart-pol-expr" id="id57"><span class="docutils literal"><span class="pre">monicpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#icontent-pol-expr" id="id58"><span class="docutils literal"><span class="pre">icontent(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#primpart-pol-expr" id="id59"><span class="docutils literal"><span class="pre">primpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#quorem-pol-expr-pol-expr" id="id60"><span class="docutils literal"><span class="pre">quorem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#quo-pol-expr-pol-expr" id="id61"><span class="docutils literal"><span class="pre">quo(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#rem-pol-expr-pol-expr" id="id62"><span class="docutils literal"><span class="pre">rem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#prem-pol-expr-1-pol-expr-2" id="id63"><span class="docutils literal"><span class="pre">prem(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#divmod-pol-expr-1-pol-expr-2" id="id64"><span class="docutils literal"><span class="pre">divmod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#mod-pol-expr-1-pol-expr-2" id="id65"><span class="docutils literal"><span class="pre">mod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#polgcd-pol-expr-1-pol-expr-2" id="id66"><span class="docutils literal"><span class="pre">polgcd(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;, <span class="pre">...)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#resultant-pol-expr-1-pol-expr-2" id="id67"><span class="docutils literal"><span class="pre">resultant(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#disc-pol-expr" id="id68"><span class="docutils literal"><span class="pre">disc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polpowmod-pol-expr-1-num-expr-pol-expr-2" id="id69"><span class="docutils literal"><span class="pre">polpowmod(&lt;pol.</span> expr. 1&gt;, &lt;num. <span class="pre">expr.&gt;,</span> &lt;pol. expr. 2&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#rdcoeffs-pol-expr" id="id70"><span class="docutils literal"><span class="pre">rdcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#rdzcoeffs-pol-expr" id="id71"><span class="docutils literal"><span class="pre">rdzcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#diff1-pol-expr" id="id72"><span class="docutils literal"><span class="pre">diff1(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#diff2-pol-expr" id="id73"><span class="docutils literal"><span class="pre">diff2(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
-<li><p><a class="reference internal" href="#diffn-pol-expr-p-num-expr-n" id="id74"><span class="docutils literal"><span class="pre">diffn(&lt;pol.</span> expr. P&gt;, &lt;num. expr. n&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#antider-pol-expr-p" id="id75"><span class="docutils literal"><span class="pre">antider(&lt;pol.</span> expr. P&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#intfrom-pol-expr-p-pol-expr-c" id="id76"><span class="docutils literal"><span class="pre">intfrom(&lt;pol.</span> expr. P&gt;, &lt;pol. expr. c&gt;)</span></a></p></li>
-<li><p><a class="reference internal" href="#integral-pol-expr-p-pol-expr-a-pol-expr-b" id="id77"><span class="docutils literal"><span class="pre">integral(&lt;pol.</span> expr. P&gt;, [&lt;pol. expr. a&gt;, &lt;pol. expr. <span class="pre">b&gt;])</span></span></a></p></li>
-</ul>
-</li>
-<li><p><a class="reference internal" href="#examples-of-localization-of-roots" id="id78">Examples of localization of roots</a></p>
-<ul>
-<li><p><a class="reference internal" href="#a-typical-example" id="id79">A typical example</a></p></li>
-<li><p><a class="reference internal" href="#a-degree-four-polynomial-with-nearby-roots" id="id80">A degree four polynomial with nearby roots</a></p></li>
-<li><p><a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots" id="id81">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></p></li>
-<li><p><a class="reference internal" href="#a-degree-five-polynomial-with-three-rational-roots" id="id82">A degree five polynomial with three rational roots</a></p></li>
-<li><p><a class="reference internal" href="#a-mignotte-type-polynomial" id="id83">A Mignotte type polynomial</a></p></li>
-<li><p><a class="reference internal" href="#the-wilkinson-polynomial" id="id84">The Wilkinson polynomial</a></p></li>
-<li><p><a class="reference internal" href="#the-second-wilkinson-polynomial" id="id85">The second Wilkinson polynomial</a></p></li>
-<li><p><a class="reference internal" href="#the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots" id="id86">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></p></li>
-<li><p><a class="reference internal" href="#roots-of-chebyshev-polynomials" id="id87">Roots of Chebyshev polynomials</a></p></li>
-</ul>
-</li>
-<li><p><a class="reference internal" href="#non-expandable-macros" id="id88">Non-expandable macros</a></p>
+<li><p><a class="reference internal" href="#warning-about-unstability-of-the-new-syntax" id="id40">Warning about unstability of the new syntax</a></p></li>
+<li><p><a class="reference internal" href="#infix-operators" id="id41">Infix operators <span class="docutils literal">+, <span class="pre">-,</span> *, /, **, ^</span></a></p></li>
+<li><p><a class="reference internal" href="#experimental-infix-operators" id="id42">Experimental infix operators <span class="docutils literal">//, /:</span></a></p></li>
+<li><p><a class="reference internal" href="#comparison-operators" id="id43">Comparison operators <span class="docutils literal">&lt;, &gt;, &lt;=, &gt;=, ==, !=</span></a></p></li>
+<li><p><a class="reference internal" href="#pol-nutple-expression" id="id44"><span class="docutils literal"><span class="pre">pol(&lt;nutple</span> expression&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#lpol-nutple-expression" id="id45"><span class="docutils literal"><span class="pre">lpol(&lt;nutple</span> expression&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#xinteval-pol-expr" id="id46"><span class="docutils literal"><span class="pre">\xinteval{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#evalp-pol-expr-pol-expr" id="id47"><span class="docutils literal"><span class="pre">evalp(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. expr&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#deg-pol-expr" id="id48"><span class="docutils literal"><span class="pre">deg(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#coeffs-pol-expr" id="id49"><span class="docutils literal"><span class="pre">coeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#lcoeffs-pol-expr" id="id50"><span class="docutils literal"><span class="pre">lcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#coeff-pol-expr-num-expr" id="id51"><span class="docutils literal"><span class="pre">coeff(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;num. <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#lc-pol-expr" id="id52"><span class="docutils literal"><span class="pre">lc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#monicpart-pol-expr" id="id53"><span class="docutils literal"><span class="pre">monicpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#cont-pol-expr" id="id54"><span class="docutils literal"><span class="pre">cont(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#primpart-pol-expr" id="id55"><span class="docutils literal"><span class="pre">primpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#quorem-pol-expr-pol-expr" id="id56"><span class="docutils literal"><span class="pre">quorem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#quo-pol-expr-pol-expr" id="id57"><span class="docutils literal"><span class="pre">quo(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#rem-pol-expr-pol-expr" id="id58"><span class="docutils literal"><span class="pre">rem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#prem-pol-expr-1-pol-expr-2" id="id59"><span class="docutils literal"><span class="pre">prem(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#divmod-pol-expr-1-pol-expr-2" id="id60"><span class="docutils literal"><span class="pre">divmod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#mod-pol-expr-1-pol-expr-2" id="id61"><span class="docutils literal"><span class="pre">mod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#polgcd-pol-expr-1-pol-expr-2" id="id62"><span class="docutils literal"><span class="pre">polgcd(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;, <span class="pre">...)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#resultant-pol-expr-1-pol-expr-2" id="id63"><span class="docutils literal"><span class="pre">resultant(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#disc-pol-expr" id="id64"><span class="docutils literal"><span class="pre">disc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polpowmod-pol-expr-1-num-expr-pol-expr-2" id="id65"><span class="docutils literal"><span class="pre">polpowmod(&lt;pol.</span> expr. 1&gt;, &lt;num. <span class="pre">expr.&gt;,</span> &lt;pol. expr. 2&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#rdcoeffs-pol-expr" id="id66"><span class="docutils literal"><span class="pre">rdcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#rdzcoeffs-pol-expr" id="id67"><span class="docutils literal"><span class="pre">rdzcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#diff1-pol-expr" id="id68"><span class="docutils literal"><span class="pre">diff1(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#diff2-pol-expr" id="id69"><span class="docutils literal"><span class="pre">diff2(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></p></li>
+<li><p><a class="reference internal" href="#diffn-pol-expr-p-num-expr-n" id="id70"><span class="docutils literal"><span class="pre">diffn(&lt;pol.</span> expr. P&gt;, &lt;num. expr. n&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#antider-pol-expr-p" id="id71"><span class="docutils literal"><span class="pre">antider(&lt;pol.</span> expr. P&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#intfrom-pol-expr-p-pol-expr-c" id="id72"><span class="docutils literal"><span class="pre">intfrom(&lt;pol.</span> expr. P&gt;, &lt;pol. expr. c&gt;)</span></a></p></li>
+<li><p><a class="reference internal" href="#integral-pol-expr-p-pol-expr-a-pol-expr-b" id="id73"><span class="docutils literal"><span class="pre">integral(&lt;pol.</span> expr. P&gt;, [&lt;pol. expr. a&gt;, &lt;pol. expr. <span class="pre">b&gt;])</span></span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#examples-of-localization-of-roots" id="id74">Examples of localization of roots</a></p>
<ul>
-<li><p><a class="reference internal" href="#poldef-polname-letter-expression-using-the-letter-as-indeterminate" id="id89"><span class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression using the letter as indeterminate;</span></a></p></li>
-<li><p><a class="reference internal" href="#poldef-letter-polname-expression-using-the-letter-as-indeterminate" id="id90"><span class="docutils literal"><span class="pre">\PolDef[letter]{polname}{expression</span> using the letter as indeterminate}</span></a></p></li>
-<li><p><a class="reference internal" href="#polgenfloatvariant-polname" id="id91"><span class="docutils literal">\PolGenFloatVariant{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#pollet-polname-2-polname-1" id="id92"><span class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polgloballet-polname-2-polname-1" id="id93"><span class="docutils literal"><span class="pre">\PolGlobalLet{polname_2}={polname_1}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polassign-polname-toarray-macro" id="id94"><span class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polget-polname-fromarray-macro" id="id95"><span class="docutils literal"><span class="pre">\PolGet{polname}\fromarray\macro</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polfromcsv-polname-csv" id="id96"><span class="docutils literal"><span class="pre">\PolFromCSV{polname}{&lt;csv&gt;}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltypeset-pol-expr" id="id97"><span class="docutils literal"><span class="pre">\PolTypeset{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
+<li><p><a class="reference internal" href="#a-typical-example" id="id75">A typical example</a></p></li>
+<li><p><a class="reference internal" href="#a-degree-four-polynomial-with-nearby-roots" id="id76">A degree four polynomial with nearby roots</a></p></li>
+<li><p><a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots" id="id77">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></p></li>
+<li><p><a class="reference internal" href="#a-degree-five-polynomial-with-three-rational-roots" id="id78">A degree five polynomial with three rational roots</a></p></li>
+<li><p><a class="reference internal" href="#a-mignotte-type-polynomial" id="id79">A Mignotte type polynomial</a></p></li>
+<li><p><a class="reference internal" href="#the-wilkinson-polynomial" id="id80">The Wilkinson polynomial</a></p></li>
+<li><p><a class="reference internal" href="#the-second-wilkinson-polynomial" id="id81">The second Wilkinson polynomial</a></p></li>
+<li><p><a class="reference internal" href="#the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots" id="id82">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></p></li>
+<li><p><a class="reference internal" href="#roots-of-chebyshev-polynomials" id="id83">Roots of Chebyshev polynomials</a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#non-expandable-macros" id="id84">Non-expandable macros</a></p>
<ul>
-<li><p><a class="reference internal" href="#poltypesetcmd-raw-coeff" id="id98"><span class="docutils literal">\PolTypesetCmd{raw_coeff}</span></a></p></li>
-<li><p><a class="reference internal" href="#poltypesetone-raw-coeff" id="id99"><span class="docutils literal">\PolTypesetOne{raw_coeff}</span></a></p></li>
-<li><p><a class="reference internal" href="#id9" id="id100"><span class="docutils literal">\PolTypesetMonomialCmd</span></a></p></li>
-<li><p><a class="reference internal" href="#poltypesetcmdprefix-raw-coeff" id="id101"><span class="docutils literal">\PolTypesetCmdPrefix{raw_coeff}</span></a></p></li>
-</ul>
-</li>
-<li><p><a class="reference internal" href="#id11" id="id102"><span class="docutils literal"><span class="pre">\PolTypeset*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poldiff-polname-1-polname-2" id="id103"><span class="docutils literal"><span class="pre">\PolDiff{polname_1}{polname_2}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poldiff-n-polname-1-polname-2" id="id104"><span class="docutils literal"><span class="pre">\PolDiff[N]{polname_1}{polname_2}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polantidiff-polname-1-polname-2" id="id105"><span class="docutils literal"><span class="pre">\PolAntiDiff{polname_1}{polname_2}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polantidiff-n-polname-1-polname-2" id="id106"><span class="docutils literal"><span class="pre">\PolAntiDiff[N]{polname_1}{polname_2}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poldivide-polname-1-polname-2-polname-q-polname-r" id="id107"><span class="docutils literal"><span class="pre">\PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polquo-polname-1-polname-2-polname-q" id="id108"><span class="docutils literal"><span class="pre">\PolQuo{polname_1}{polname_2}{polname_Q}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polrem-polname-1-polname-2-polname-r" id="id109"><span class="docutils literal"><span class="pre">\PolRem{polname_1}{polname_2}{polname_R}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polgcd-polname-1-polname-2-polname-gcd" id="id110"><span class="docutils literal"><span class="pre">\PolGCD{polname_1}{polname_2}{polname_GCD}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#non-expandable-macros-related-to-the-root-localization-routines" id="id111">Non-expandable macros related to the root localization routines</a></p>
+<li><p><a class="reference internal" href="#poldef-polname-letter-expression-using-the-letter-as-indeterminate" id="id85"><span class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression using the letter as indeterminate;</span></a></p></li>
+<li><p><a class="reference internal" href="#poldef-letter-polname-expr-using-the-letter-as-indeterminate" id="id86"><span class="docutils literal"><span class="pre">\PolDef[&lt;letter&gt;]{&lt;polname&gt;}{&lt;expr.</span> using the letter as indeterminate&gt;}</span></a></p></li>
+<li><p><a class="reference internal" href="#polgenfloatvariant-polname" id="id87"><span class="docutils literal"><span class="pre">\PolGenFloatVariant{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltypeset-pol-expr" id="id88"><span class="docutils literal"><span class="pre">\PolTypeset{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
<ul>
-<li><p><a class="reference internal" href="#poltosturm-polname-sturmname" id="id112"><span class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#id13" id="id113"><span class="docutils literal"><span class="pre">\PolToSturm*{polname}{sturmname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsettosturmchainsignchangesat-macro-sturmname-fraction" id="id114"><span class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsettonbofzeroswithin-macro-sturmname-value-a-value-b" id="id115"><span class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezeros-sturmname" id="id116"><span class="docutils literal">\PolSturmIsolateZeros{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#id15" id="id117"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{sturmname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#id17" id="id118"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezerosandgetmultiplicities-sturmname" id="id119"><span class="docutils literal">\PolSturmIsolateZerosAndGetMultiplicities{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname" id="id120"><span class="docutils literal">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname" id="id121"><span class="docutils literal">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polrefineinterval-sturmname-index" id="id122"><span class="docutils literal"><span class="pre">\PolRefineInterval*{sturmname}{index}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polrefineinterval-n-sturmname-index" id="id123"><span class="docutils literal"><span class="pre">\PolRefineInterval[N]{sturmname}{index}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polensureintervallength-sturmname-index-e" id="id124"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLength{sturmname}{index}{E}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polensureintervallengths-sturmname-e" id="id125"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{sturmname}{E}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervals-varname-sturmname" id="id126"><span class="docutils literal"><span class="pre">\PolPrintIntervals[varname]{sturmname}</span></span></a></p>
+<li><p><a class="reference internal" href="#poltypesetcmd-raw-coeff" id="id89"><span class="docutils literal"><span class="pre">\PolTypesetCmd{&lt;raw_coeff&gt;}</span></span></a></p>
<ul>
-<li><p><a class="reference internal" href="#polprintintervalsnorealroots" id="id127"><span class="docutils literal">\PolPrintIntervalsNoRealRoots</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsbeginenv" id="id128"><span class="docutils literal">\PolPrintIntervalsBeginEnv</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsendenv" id="id129"><span class="docutils literal">\PolPrintIntervalsEndEnv</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsknownroot" id="id130"><span class="docutils literal">\PolPrintIntervalsKnownRoot</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsunknownroot" id="id131"><span class="docutils literal">\PolPrintIntervalsUnknownRoot</span></a></p></li>
-<li><p><a class="reference internal" href="#id18" id="id132"><span class="docutils literal">\PolPrintIntervalsPrintExactZero</span></a></p></li>
-<li><p><a class="reference internal" href="#id19" id="id133"><span class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</span></a></p></li>
-<li><p><a class="reference internal" href="#id20" id="id134"><span class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</span></a></p></li>
+<li><p><a class="reference internal" href="#polifcoeffisplusorminusone-t-f" id="id90"><span class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{T}{F}</span></span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#poltypesetone-raw-coeff" id="id91"><span class="docutils literal"><span class="pre">\PolTypesetOne{&lt;raw_coeff&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#id9" id="id92"><span class="docutils literal">\PolTypesetMonomialCmd</span></a></p></li>
+<li><p><a class="reference internal" href="#poltypesetcmdprefix-raw-coeff" id="id93"><span class="docutils literal"><span class="pre">\PolTypesetCmdPrefix{&lt;raw_coeff&gt;}</span></span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#id22" id="id135"><span class="docutils literal"><span class="pre">\PolPrintIntervals*[varname]{sturmname}</span></span></a></p>
+<li><p><a class="reference internal" href="#id11" id="id94"><span class="docutils literal"><span class="pre">\PolTypeset*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#non-expandable-macros-related-to-the-root-localization-routines" id="id95">Non-expandable macros related to the root localization routines</a></p>
<ul>
-<li><p><a class="reference internal" href="#polprintintervalsprintmultiplicity" id="id136"><span class="docutils literal">\PolPrintIntervalsPrintMultiplicity</span></a></p></li>
+<li><p><a class="reference internal" href="#poltosturm-polname-sturmname" id="id96"><span class="docutils literal"><span class="pre">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#id13" id="id97"><span class="docutils literal"><span class="pre">\PolToSturm*{&lt;polname&gt;}{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatezeros-sturmname" id="id98"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#id15" id="id99"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</span></span></a></p>
+<ul>
+<li><p><a class="reference internal" href="#polsturmisolatezerosandgetmultiplicities-sturmname" id="id100"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{&lt;sturmname&gt;}</span></span></a></p></li>
</ul>
</li>
+<li><p><a class="reference internal" href="#id17" id="id101"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</span></span></a></p>
+<ul>
+<li><p><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname" id="id102"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{&lt;sturmname&gt;}</span></span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#polmapcoeffs-macro-polname" id="id137"><span class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{polname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polreducecoeffs-polname" id="id138"><span class="docutils literal">\PolReduceCoeffs{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#id24" id="id139"><span class="docutils literal"><span class="pre">\PolReduceCoeffs*{polname}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polmakemonic-polname" id="id140"><span class="docutils literal">\PolMakeMonic{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polmakeprimitive-polname" id="id141"><span class="docutils literal">\PolMakePrimitive{polname}</span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname" id="id103"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polrefineinterval-sturmname-index" id="id104"><span class="docutils literal"><span class="pre">\PolRefineInterval*{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polrefineinterval-n-sturmname-index" id="id105"><span class="docutils literal"><span class="pre">\PolRefineInterval[N]{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polensureintervallength-sturmname-index-exponent" id="id106"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLength{&lt;sturmname&gt;}{&lt;index&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polensureintervallengths-sturmname-exponent" id="id107"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{&lt;sturmname&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervals-varname-sturmname" id="id108"><span class="docutils literal"><span class="pre">\PolPrintIntervals[&lt;varname&gt;]{&lt;sturmname&gt;}</span></span></a></p>
+<ul>
+<li><p><a class="reference internal" href="#polprintintervalsnorealroots" id="id109"><span class="docutils literal">\PolPrintIntervalsNoRealRoots</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsbeginenv" id="id110"><span class="docutils literal">\PolPrintIntervalsBeginEnv</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsendenv" id="id111"><span class="docutils literal">\PolPrintIntervalsEndEnv</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsknownroot" id="id112"><span class="docutils literal">\PolPrintIntervalsKnownRoot</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsunknownroot" id="id113"><span class="docutils literal">\PolPrintIntervalsUnknownRoot</span></a></p></li>
+<li><p><a class="reference internal" href="#id18" id="id114"><span class="docutils literal">\PolPrintIntervalsPrintExactZero</span></a></p></li>
+<li><p><a class="reference internal" href="#id19" id="id115"><span class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</span></a></p></li>
+<li><p><a class="reference internal" href="#id20" id="id116"><span class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#expandable-macros" id="id142">Expandable macros</a></p>
+<li><p><a class="reference internal" href="#id22" id="id117"><span class="docutils literal"><span class="pre">\PolPrintIntervals*[&lt;varname&gt;]{&lt;sturmname&gt;}</span></span></a></p>
<ul>
-<li><p><a class="reference internal" href="#poleval-polname-atexpr-numerical-expression" id="id143"><span class="docutils literal"><span class="pre">\PolEval{polname}\AtExpr{numerical</span> expression}</span></a></p></li>
-<li><p><a class="reference internal" href="#poleval-polname-at-fraction" id="id144"><span class="docutils literal"><span class="pre">\PolEval{polname}\At{fraction}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polevalreduced-polname-atexpr-numerical-expression" id="id145"><span class="docutils literal"><span class="pre">\PolEvalReduced{polname}\AtExpr{numerical</span> expression}</span></a></p></li>
-<li><p><a class="reference internal" href="#polevalreduced-polname-at-fraction" id="id146"><span class="docutils literal"><span class="pre">\PolEvalReduced{polname}\At{fraction}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polfloateval-polname-atexpr-numerical-expression" id="id147"><span class="docutils literal"><span class="pre">\PolFloatEval{polname}\AtExpr{numerical</span> expression}</span></a></p></li>
-<li><p><a class="reference internal" href="#polfloateval-polname-at-fraction" id="id148"><span class="docutils literal"><span class="pre">\PolFloatEval{polname}\At{fraction}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polifcoeffisplusorminusone-a-b" id="id149"><span class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{A}{B}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polleadingcoeff-polname" id="id150"><span class="docutils literal">\PolLeadingCoeff{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polnthcoeff-polname-number" id="id151"><span class="docutils literal"><span class="pre">\PolNthCoeff{polname}{number}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poldegree-polname" id="id152"><span class="docutils literal">\PolDegree{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#policontent-polname" id="id153"><span class="docutils literal">\PolIContent{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexpr-pol-expr" id="id154"><span class="docutils literal"><span class="pre">\PolToExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
+<li><p><a class="reference internal" href="#polprintintervalsprintmultiplicity" id="id118"><span class="docutils literal">\PolPrintIntervalsPrintMultiplicity</span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#polsettosturmchainsignchangesat-foo-sturmname-value" id="id119"><span class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\foo}{&lt;sturmname&gt;}{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsettonbofzeroswithin-foo-sturmname-value-left-value-right" id="id120"><span class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\foo}{&lt;sturmname&gt;}{&lt;value_left&gt;}{&lt;value_right&gt;}</span></span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#pollet-polname-2-polname-1" id="id121"><span class="docutils literal"><span class="pre">\PolLet{&lt;polname_2&gt;}={&lt;polname_1&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polgloballet-polname-2-polname-1" id="id122"><span class="docutils literal"><span class="pre">\PolGlobalLet{&lt;polname_2&gt;}={&lt;polname_1&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polassign-polname-toarray-macro" id="id123"><span class="docutils literal"><span class="pre">\PolAssign{&lt;polname&gt;}\toarray\macro</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polget-polname-fromarray-macro" id="id124"><span class="docutils literal"><span class="pre">\PolGet{&lt;polname&gt;}\fromarray\macro</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polfromcsv-polname-csv" id="id125"><span class="docutils literal"><span class="pre">\PolFromCSV{&lt;polname&gt;}{&lt;csv&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polmapcoeffs-macro-polname" id="id126"><span class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polreducecoeffs-polname" id="id127"><span class="docutils literal"><span class="pre">\PolReduceCoeffs{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#id24" id="id128"><span class="docutils literal"><span class="pre">\PolReduceCoeffs*{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polmakemonic-polname" id="id129"><span class="docutils literal"><span class="pre">\PolMakeMonic{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polmakeprimitive-polname" id="id130"><span class="docutils literal"><span class="pre">\PolMakePrimitive{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poldiff-polname-1-polname-2" id="id131"><span class="docutils literal"><span class="pre">\PolDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poldiff-n-polname-1-polname-2" id="id132"><span class="docutils literal"><span class="pre">\PolDiff[N]{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polantidiff-polname-1-polname-2" id="id133"><span class="docutils literal"><span class="pre">\PolAntiDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polantidiff-n-polname-1-polname-2" id="id134"><span class="docutils literal"><span class="pre">\PolAntiDiff[N]{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poldivide-polname-1-polname-2-polname-q-polname-r" id="id135"><span class="docutils literal"><span class="pre">\PolDivide{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_Q&gt;}{&lt;polname_R&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polquo-polname-1-polname-2-polname-q" id="id136"><span class="docutils literal"><span class="pre">\PolQuo{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_Q&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polrem-polname-1-polname-2-polname-r" id="id137"><span class="docutils literal"><span class="pre">\PolRem{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_R&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polgcd-polname-1-polname-2-polname-gcd" id="id138"><span class="docutils literal"><span class="pre">\PolGCD{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_GCD&gt;}</span></span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#expandable-macros" id="id139">Expandable macros</a></p>
<ul>
-<li><p><a class="reference internal" href="#id31" id="id155"><span class="docutils literal">\PolToExprVar</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexprinvar" id="id156"><span class="docutils literal">\PolToExprInVar</span></a></p></li>
-<li><p><a class="reference internal" href="#id32" id="id157"><span class="docutils literal">\PolToExprTimes</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexprcaret" id="id158"><span class="docutils literal">\PolToExprCaret</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexprcmd-raw-coeff" id="id159"><span class="docutils literal">\PolToExprCmd{raw_coeff}</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexproneterm-raw-coeff-number" id="id160"><span class="docutils literal"><span class="pre">\PolToExprOneTerm{raw_coeff}{number}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexpronetermstylea-raw-coeff-number" id="id161"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{raw_coeff}{number}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexpronetermstyleb-raw-coeff-number" id="id162"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{raw_coeff}{number}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexprtermprefix-raw-coeff" id="id163"><span class="docutils literal">\PolToExprTermPrefix{raw_coeff}</span></a></p></li>
-</ul>
-</li>
-<li><p><a class="reference internal" href="#id34" id="id164"><span class="docutils literal"><span class="pre">\PolToExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltofloatexpr-pol-expr" id="id165"><span class="docutils literal"><span class="pre">\PolToFloatExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
+<li><p><a class="reference internal" href="#poltoexpr-pol-expr" id="id140"><span class="docutils literal"><span class="pre">\PolToExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
<ul>
-<li><p><a class="reference internal" href="#poltofloatexproneterm-raw-coeff-number" id="id166"><span class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{raw_coeff}{number}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltofloatexprcmd-raw-coeff" id="id167"><span class="docutils literal">\PolToFloatExprCmd{raw_coeff}</span></a></p></li>
+<li><p><a class="reference internal" href="#id27" id="id141"><span class="docutils literal">\PolToExprVar</span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexprinvar" id="id142"><span class="docutils literal">\PolToExprInVar</span></a></p></li>
+<li><p><a class="reference internal" href="#id28" id="id143"><span class="docutils literal">\PolToExprTimes</span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexprcaret" id="id144"><span class="docutils literal">\PolToExprCaret</span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexprcmd-raw-coeff" id="id145"><span class="docutils literal"><span class="pre">\PolToExprCmd{&lt;raw_coeff&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexproneterm-raw-coeff-exponent" id="id146"><span class="docutils literal"><span class="pre">\PolToExprOneTerm{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexpronetermstylea-raw-coeff-exponent" id="id147"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexpronetermstyleb-raw-coeff-exponent" id="id148"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexprtermprefix-raw-coeff" id="id149"><span class="docutils literal"><span class="pre">\PolToExprTermPrefix{&lt;raw_coeff&gt;}</span></span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#id38" id="id168"><span class="docutils literal"><span class="pre">\PolToFloatExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#poltolist-polname" id="id169"><span class="docutils literal">\PolToList{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#poltocsv-polname" id="id170"><span class="docutils literal">\PolToCSV{polname}</span></a></p></li>
-<li><p><a class="reference internal" href="#expandable-macros-related-to-the-root-localization-routines" id="id171">Expandable macros related to the root localization routines</a></p>
+<li><p><a class="reference internal" href="#poltofloatexpr-pol-expr" id="id150"><span class="docutils literal"><span class="pre">\PolToFloatExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p>
<ul>
-<li><p><a class="reference internal" href="#polsturmchainlength-sturmname" id="id172"><span class="docutils literal">\PolSturmChainLength{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-a-b" id="id173"><span class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatedzeroleft-sturmname-index" id="id174"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{sturmname}{index}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index" id="id175"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{sturmname}{index}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index" id="id176"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname" id="id177"><span class="docutils literal">\PolSturmNbOfIsolatedZeros{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value" id="id178"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression" id="id179"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value" id="id180"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression" id="id181"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrationalroots-sturmname" id="id182"><span class="docutils literal">\PolSturmNbOfRationalRoots{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname" id="id183"><span class="docutils literal">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalroot-sturmname-k" id="id184"><span class="docutils literal"><span class="pre">\PolSturmRationalRoot{sturmname}{k}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k" id="id185"><span class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{sturmname}{k}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k" id="id186"><span class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{sturmname}{k}</span></span></a></p></li>
-<li><p><a class="reference internal" href="#polintervalwidth-sturmname-index" id="id187"><span class="docutils literal"><span class="pre">\PolIntervalWidth{sturmname}{index}</span></span></a></p></li>
-</ul>
-</li>
-<li><p><a class="reference internal" href="#expandable-macros-for-use-within-execution-of-polprintintervals" id="id188">Expandable macros for use within execution of <span class="docutils literal">\PolPrintIntervals</span></a></p>
+<li><p><a class="reference internal" href="#poltofloatexproneterm-raw-coeff-exponent" id="id151"><span class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltofloatexprcmd-raw-coeff" id="id152"><span class="docutils literal"><span class="pre">\PolToFloatExprCmd{&lt;raw_coeff&gt;}</span></span></a></p></li>
+</ul>
+</li>
+<li><p><a class="reference internal" href="#id30" id="id153"><span class="docutils literal"><span class="pre">\PolToExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#id32" id="id154"><span class="docutils literal"><span class="pre">\PolToFloatExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polnthcoeff-polname-index" id="id155"><span class="docutils literal"><span class="pre">\PolNthCoeff{&lt;polname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polleadingcoeff-polname" id="id156"><span class="docutils literal"><span class="pre">\PolLeadingCoeff{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poldegree-polname" id="id157"><span class="docutils literal"><span class="pre">\PolDegree{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#policontent-polname" id="id158"><span class="docutils literal"><span class="pre">\PolIContent{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltolist-polname" id="id159"><span class="docutils literal"><span class="pre">\PolToList{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poltocsv-polname" id="id160"><span class="docutils literal"><span class="pre">\PolToCSV{&lt;polname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poleval-polname-atexpr-num-expr" id="id161"><span class="docutils literal"><span class="pre">\PolEval{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#poleval-polname-at-value" id="id162"><span class="docutils literal"><span class="pre">\PolEval{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polevalreduced-polname-atexpr-num-expr" id="id163"><span class="docutils literal"><span class="pre">\PolEvalReduced{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polevalreduced-polname-at-value" id="id164"><span class="docutils literal"><span class="pre">\PolEvalReduced{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polfloateval-polname-atexpr-num-expr" id="id165"><span class="docutils literal"><span class="pre">\PolFloatEval{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polfloateval-polname-at-value" id="id166"><span class="docutils literal"><span class="pre">\PolFloatEval{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#expandable-macros-related-to-the-root-localization-routines" id="id167">Expandable macros related to the root localization routines</a></p>
<ul>
-<li><p><a class="reference internal" href="#polprintintervalsthevar" id="id189"><span class="docutils literal">\PolPrintIntervalsTheVar</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalstheindex" id="id190"><span class="docutils literal">\PolPrintIntervalsTheIndex</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsthesturmname" id="id191"><span class="docutils literal">\PolPrintIntervalsTheSturmName</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalstheleftendpoint" id="id192"><span class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalstherightendpoint" id="id193"><span class="docutils literal">\PolPrintIntervalsTheRightEndPoint</span></a></p></li>
-<li><p><a class="reference internal" href="#polprintintervalsthemultiplicity" id="id194"><span class="docutils literal">\PolPrintIntervalsTheMultiplicity</span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmchainlength-sturmname" id="id168"><span class="docutils literal"><span class="pre">\PolSturmChainLength{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-t-f" id="id169"><span class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{&lt;sturmname&gt;}{&lt;index&gt;}{T}{F}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatedzeroleft-sturmname-index" id="id170"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index" id="id171"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index" id="id172"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname" id="id173"><span class="docutils literal"><span class="pre">\PolSturmNbOfIsolatedZeros{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value" id="id174"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-num-expr" id="id175"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value" id="id176"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-num-expr" id="id177"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrationalroots-sturmname" id="id178"><span class="docutils literal"><span class="pre">\PolSturmNbOfRationalRoots{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname" id="id179"><span class="docutils literal"><span class="pre">\PolSturmNbOfRationalRootsWithMultiplicities{&lt;sturmname&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalroot-sturmname-k" id="id180"><span class="docutils literal"><span class="pre">\PolSturmRationalRoot{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k" id="id181"><span class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k" id="id182"><span class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#polintervalwidth-sturmname-index" id="id183"><span class="docutils literal"><span class="pre">\PolIntervalWidth{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></p></li>
+<li><p><a class="reference internal" href="#expandable-macros-for-use-within-execution-of-polprintintervals" id="id184">Expandable macros for use within execution of <span class="docutils literal">\PolPrintIntervals</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsthevar" id="id185"><span class="docutils literal">\PolPrintIntervalsTheVar</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalstheindex" id="id186"><span class="docutils literal">\PolPrintIntervalsTheIndex</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsthesturmname" id="id187"><span class="docutils literal">\PolPrintIntervalsTheSturmName</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalstheleftendpoint" id="id188"><span class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalstherightendpoint" id="id189"><span class="docutils literal">\PolPrintIntervalsTheRightEndPoint</span></a></p></li>
+<li><p><a class="reference internal" href="#polprintintervalsthemultiplicity" id="id190"><span class="docutils literal">\PolPrintIntervalsTheMultiplicity</span></a></p></li>
</ul>
</li>
</ul>
</li>
-<li><p><a class="reference internal" href="#booleans-with-default-setting-as-indicated" id="id195">Booleans (with default setting as indicated)</a></p>
+<li><p><a class="reference internal" href="#booleans-with-default-setting-as-indicated" id="id191">Booleans (with default setting as indicated)</a></p>
<ul>
-<li><p><a class="reference internal" href="#xintverbosefalse" id="id196"><span class="docutils literal">\xintverbosefalse</span></a></p></li>
-<li><p><a class="reference internal" href="#polnewpolverbosefalse" id="id197"><span class="docutils literal">\polnewpolverbosefalse</span></a></p></li>
-<li><p><a class="reference internal" href="#poltypesetallfalse" id="id198"><span class="docutils literal">\poltypesetallfalse</span></a></p></li>
-<li><p><a class="reference internal" href="#poltoexprallfalse" id="id199"><span class="docutils literal">\poltoexprallfalse</span></a></p></li>
+<li><p><a class="reference internal" href="#xintverbosefalse" id="id192"><span class="docutils literal">\xintverbosefalse</span></a></p></li>
+<li><p><a class="reference internal" href="#polnewpolverbosefalse" id="id193"><span class="docutils literal">\polnewpolverbosefalse</span></a></p></li>
+<li><p><a class="reference internal" href="#poltypesetallfalse" id="id194"><span class="docutils literal">\poltypesetallfalse</span></a></p></li>
+<li><p><a class="reference internal" href="#poltoexprallfalse" id="id195"><span class="docutils literal">\poltoexprallfalse</span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#utilies" id="id200">Utilies</a></p>
+<li><p><a class="reference internal" href="#utilies" id="id196">Utilies</a></p>
<ul>
-<li><p><a class="reference internal" href="#poldectostring-decimal-number" id="id201"><span class="docutils literal">\PolDecToString{decimal number}</span></a></p></li>
-<li><p><a class="reference internal" href="#polexprsetup" id="id202"><span class="docutils literal">\polexprsetup</span></a></p></li>
+<li><p><a class="reference internal" href="#poldectostring-decimal-number" id="id197"><span class="docutils literal">\PolDecToString{decimal number}</span></a></p></li>
+<li><p><a class="reference internal" href="#polexprsetup" id="id198"><span class="docutils literal">\polexprsetup</span></a></p></li>
</ul>
</li>
-<li><p><a class="reference internal" href="#technicalities" id="id203">Technicalities</a></p></li>
-<li><p><a class="reference internal" href="#change-log" id="id204">CHANGE LOG</a></p></li>
-<li><p><a class="reference internal" href="#acknowledgments" id="id205">Acknowledgments</a></p></li>
+<li><p><a class="reference internal" href="#technicalities" id="id199">Technicalities</a></p></li>
+<li><p><a class="reference internal" href="#change-log" id="id200">CHANGE LOG</a></p></li>
+<li><p><a class="reference internal" href="#acknowledgments" id="id201">Acknowledgments</a></p></li>
</ul>
</div>
<div class="section" id="usage">
-<h1><a class="toc-backref" href="#id41">Usage</a></h1>
+<h1><a class="toc-backref" href="#id35">Usage</a></h1>
<p>The package can be used with TeX based formats incorporating the e-TeX
primitives. The <span class="docutils literal">\expanded</span> primitive available generally since
TeXLive 2019 is required.</p>
@@ -831,7 +839,7 @@ TeX macro format used if needed.</p>
</div>
</div>
<div class="section" id="abstract">
-<h1><a class="toc-backref" href="#id42">Abstract</a></h1>
+<h1><a class="toc-backref" href="#id36">Abstract</a></h1>
<p>The package provides a parser <span class="docutils literal">\poldef</span> of algebraic polynomial
expressions. As it is based on <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>
the coefficients are allowed to be arbitrary rational numbers.</p>
@@ -849,7 +857,7 @@ computation of a greatest common divisor is now available directly in
syntax.</p>
</div>
<div class="section" id="prerequisites">
-<h1><a class="toc-backref" href="#id43">Prerequisites</a></h1>
+<h1><a class="toc-backref" href="#id37">Prerequisites</a></h1>
<ul>
<li><p>The user must have some understanding of TeX as a macro-expansion
based programming interface, and in particular of how <span class="docutils literal">\edef</span>
@@ -875,15 +883,41 @@ particular must know what <span class="docutils literal">\xintexpr</span>, <span
<span class="docutils literal">\xintfloateval</span> mean and what are the good practices with them.</p></li>
<li><p>The user will become quickly aware that exact computations with
fractions easily lead to very big ones in very few steps; see
-<a class="reference internal" href="#polreducecoeffs-polname">\PolReduceCoeffs{polname}</a> in this context.</p></li>
+<a class="reference internal" href="#polreducecoeffs-polname">\PolReduceCoeffs{&lt;polname&gt;}</a> in this context.</p></li>
<li><p>Finally, it is mandatory to read the entire documentation before
starting to use the package.</p></li>
</ul>
</div>
<div class="section" id="quick-syntax-overview">
-<h1><a class="toc-backref" href="#id44">Quick syntax overview</a></h1>
-<p>The syntax is:</p>
+<h1><a class="toc-backref" href="#id38">Quick syntax overview</a></h1>
+<p>The syntax to define a new polynomial is:</p>
<pre class="literal-block">\poldef polname(x):= expression in variable x;</pre>
+<p>The package is focused on exact computations, so this expression will be
+parsed by the services of <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> and accept arbitrarily big integers
+or fractions.</p>
+<p>If you are interested into numerical evaluations, for example for
+plotting, it is advisable to use the <span class="docutils literal"><span class="pre">\xintfloatexpr/\xintfloateval</span></span>
+context, as exact evaluations will quickly lead to manipulating numbers
+with dozens of digits (when the number of digits exceeds five hundreds,
+computation with <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> will become noticeably too slow, if many
+evaluations need to be done). For the polynomial to be usable as a function in
+floating point context, an extra step beyond <span class="docutils literal">\poldef</span> is required:
+see <a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a>.</p>
+<p>As a rule, the functionalities such as getting the degree, or getting
+one coefficient, or taking derivatives, etc..., i.e. anything which
+handles the polynomial as an entity and not only as a numerical
+function, are only available in the <span class="docutils literal"><span class="pre">\poldef/\xintexpr/\xinteval</span></span>
+context. The <a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a> must be used each time the
+polynomial gets modified or a new polynomial created out of it, if
+continuing computations in <span class="docutils literal">\xintfloatexpr</span> are to follow. But (see
+<a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> documentation) one can always use a sub-expression such as
+<span class="docutils literal">\xintexpr <span class="pre">deg(P)\relax</span></span> as sub-component inside a
+<span class="docutils literal"><span class="pre">\xintfloatexpr/\xintfloateval</span></span>.</p>
+<p>Conversely if perhaps the coefficients of your polynomial have become
+too gigantic and you would like to replace them with some approximation
+to keep on working in <span class="docutils literal">\xinteval</span>, not necessarily <span class="docutils literal">\xintfloateval</span>,
+see <a class="reference internal" href="#polmapcoeffs">\PolMapCoeffs</a> which can be used for example with <span class="docutils literal">\xintFloat</span>
+macro to make the float-rounding applied to the exact coefficients.</p>
<ul>
<li><p>In place of <span class="docutils literal">x</span> an arbitrary <em>dummy variable</em> is authorized,
i.e. per default one <span class="docutils literal">a, .., z, A, .., Z</span> (more letters can be declared
@@ -906,26 +940,45 @@ restrict usage of <span class="docutils literal">&#64;</span> to scratch variabl
to avoid using it to name document variable.</p>
</div>
</li>
-<li><p>The colon before the equality sign is optional and its catcode does
-not matter.</p></li>
-<li><p>The semi-colon at the end of the expression is mandatory. Its catcode
-does not matter if <span class="docutils literal">\poldef</span> is not used inside the argument of
-another macro.</p></li>
+<li><p>The colon before the equality sign is optional and its (reasonable)
+catcode does not matter.</p></li>
+<li><p>The semi-colon at the end of the expression is mandatory. Some
+contexts (such as (pdf)LaTeX with babel+frenchb) modify its catcode.
+If at top level, <span class="docutils literal">\poldef</span> resets temporarily the semi-colon catcode
+before fetching the expression, so is immune to this. There is also
+naturally no problem either if <span class="docutils literal">\poldef</span> is used in the replacement
+text of some other macro which is defined at a time the <span class="docutils literal">;</span> has its
+standard catcode, as is the case in LaTeX in the document preamble,
+even with babel+french loaded.</p>
+<p>The semi-colon intervenes in certain <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> syntax elements, within
+parentheses. This (except if the inner semi-colons are hidden within
+braces: <span class="docutils literal">{;}</span>) will break <span class="docutils literal">\poldef</span> which, contrarily to
+<a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>'s <span class="docutils literal">\xintdefvar</span>, does not balance parentheses when
+fetching the semi-colon delimited polynomial expression.</p>
+</li>
</ul>
-<p>There is an alternative syntax</p>
-<pre class="literal-block">\PolDef[optional letter]{polname}{expression in the letter}</pre>
-<p>Its optional first argument defaults to <span class="docutils literal">x</span>.</p>
+<p>Problems with the semi-colon are avoided via an alternative syntax:</p>
+<pre class="literal-block">\PolDef[optional letter]{&lt;polname&gt;}{&lt;expr. using letter as indeterminate&gt;}</pre>
+<p>The <span class="docutils literal">\PolDef</span> optional first argument defaults to <span class="docutils literal">x</span> and must be
+used as the indeterminate in the expression.</p>
+<p><span class="docutils literal">\poldef <span class="pre">f(x):=</span> 1 - x + quo(x^5,1 - x + x^2);</span></p>
<dl>
-<dt><span class="docutils literal">\poldef <span class="pre">f(x):=</span> 1 - x + quo(x^5,1 - x + x^2);</span></dt>
-<dd><p>defines polynomial <span class="docutils literal">f</span>. The indeterminate <span class="docutils literal">x</span> must be
-only submitted to algebraic operations.</p>
-<p>The <span class="docutils literal">quo()</span> function (new at <span class="docutils literal">0.8</span>) computes the euclidean
-division quotient.</p>
+<dt><span class="docutils literal"><span class="pre">\PolDef{f}{1</span> - x + quo(x^5,1 - x + x^2)}</span></dt>
+<dd><p>Both parse the polynomial
+expression, and convert it internally (currently) to the list
+of its coefficients from the constant term to the highest degree
+term.</p>
+<p>The polynomial can then be used in further polynomial definitions or
+serve as argument to package macros, or as a variable in various
+functions which will be <a class="reference internal" href="#polexpr08">described later</a>.</p>
</dd>
</dl>
<div class="admonition important">
<p class="admonition-title">Important</p>
-<p>For backwards compatibility one can currently also use:</p>
+<p>Euclidean quotient is mapped to the function <span class="docutils literal">quo()</span> (as shown
+in the example above), but
+for backwards compatibility one can currently still use the <span class="docutils literal">/</span>
+infix operator:</p>
<pre class="literal-block">\poldef f(x):= 1 - x + x^5/(1 - x + x^2);</pre>
<p>Due to precedence rules the first operand is <span class="docutils literal">x^5</span>, not of course
<span class="docutils literal"><span class="pre">1-x+x^5</span></span>.</p>
@@ -959,7 +1012,7 @@ to leave open this as a future possibility, the usage of <span class="docutils l
for the
euclidean quotient is <strong>deprecated</strong>.</p>
<p>Please start using rather the <span class="docutils literal">quo()</span> function. It is possible
-that in a future major relase <span class="docutils literal">A/B</span> with <span class="docutils literal">B</span> a non-scalar will
+that in a future major release <span class="docutils literal">A/B</span> with <span class="docutils literal">B</span> a non-scalar will
raise an error. Or, who knows, rational functions will be
implemented sometime during the next decades, and then <span class="docutils literal">A/B</span> will
naturally be the rational function.</p>
@@ -1009,6 +1062,10 @@ explicit <span class="docutils literal"><span class="pre">(P+Q)*(1+2)</span></sp
<dd><p>redefines <span class="docutils literal">f</span> in terms of itself. Prior to <span class="docutils literal">0.8</span> one needed
the right hand side to be <span class="docutils literal"><span class="pre">f(z)^2</span></span>. Also, now <span class="docutils literal">sqr(f)</span> is
possible (also <span class="docutils literal">sqr(f(x))</span> but not <span class="docutils literal"><span class="pre">sqr(f)(x)</span></span>).</p>
+<p>It may look strange that an indeterminate variable is used on
+left-hand-side even though it may be absent of right-hand-side, as
+it seems to define <span class="docutils literal">f</span> always as a polynomial function.</p>
+<p>This is a legacy of pre-<span class="docutils literal">0.8</span> context.</p>
</dd>
</dl>
<div class="admonition important">
@@ -1099,7 +1156,7 @@ polynomial variable but more generally any polynomial expression.</p>
</dl>
</div>
<div class="section" id="the-polexpr-0-8-extensions-to-the-xintexpr-syntax">
-<span id="polexpr08"></span><h1><a class="toc-backref" href="#id45">The polexpr <span class="docutils literal">0.8</span> extensions to the <span class="docutils literal">\xintexpr</span> syntax</a></h1>
+<span id="polexpr08"></span><h1><a class="toc-backref" href="#id39">The polexpr <span class="docutils literal">0.8</span> extensions to the <span class="docutils literal">\xintexpr</span> syntax</a></h1>
<p>All the syntax elements described in this section can be used in the
<span class="docutils literal"><span class="pre">\xintexpr/\xinteval</span></span> context (where polynomials can be obtained from
the <span class="docutils literal"><span class="pre">pol([])</span></span> constructor, once polexpr is loaded): their usage is
@@ -1122,7 +1179,7 @@ which means it could then be accessible with syntax such as
</ol>
</div>
<div class="section" id="warning-about-unstability-of-the-new-syntax">
-<h2><a class="toc-backref" href="#id46">Warning about unstability of the new syntax</a></h2>
+<h2><a class="toc-backref" href="#id40">Warning about unstability of the new syntax</a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Consider the entirety of this section as <strong>UNSTABLE</strong> and
@@ -1139,7 +1196,7 @@ during the week devoted to development.</p>
</div>
</div>
<div class="section" id="infix-operators">
-<h2><a class="toc-backref" href="#id47">Infix operators <span class="docutils literal">+, <span class="pre">-,</span> *, /, **, ^</span></a></h2>
+<h2><a class="toc-backref" href="#id41">Infix operators <span class="docutils literal">+, <span class="pre">-,</span> *, /, **, ^</span></a></h2>
<blockquote>
<p>As has been explained in the <a class="reference internal" href="#quick-syntax-overview">Quick syntax overview</a> these infix
operators have been made polynomial aware, not only in the
@@ -1170,7 +1227,7 @@ powers.</p>
</div>
</div>
<div class="section" id="experimental-infix-operators">
-<h2><a class="toc-backref" href="#id48">Experimental infix operators <span class="docutils literal">//, /:</span></a></h2>
+<h2><a class="toc-backref" href="#id42">Experimental infix operators <span class="docutils literal">//, /:</span></a></h2>
<blockquote>
<p>Here is the tentative behaviour of <span class="docutils literal"><span class="pre">A//B</span></span> according to types:</p>
<ul class="simple">
@@ -1204,7 +1261,7 @@ about behaviour with <span class="docutils literal">pol2</span> a scalar.</p>
</blockquote>
</div>
<div class="section" id="comparison-operators">
-<h2><a class="toc-backref" href="#id49">Comparison operators <span class="docutils literal">&lt;, &gt;, &lt;=, &gt;=, ==, !=</span></a></h2>
+<h2><a class="toc-backref" href="#id43">Comparison operators <span class="docutils literal">&lt;, &gt;, &lt;=, &gt;=, ==, !=</span></a></h2>
<blockquote>
<p><strong>NOT YET IMPLEMENTED</strong></p>
<p>As the internal representation by <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> and <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> of
@@ -1222,7 +1279,7 @@ following syntax:</p>
</blockquote>
</div>
<div class="section" id="pol-nutple-expression">
-<h2><a class="toc-backref" href="#id50"><span class="docutils literal"><span class="pre">pol(&lt;nutple</span> expression&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id44"><span class="docutils literal"><span class="pre">pol(&lt;nutple</span> expression&gt;)</span></a></h2>
<blockquote>
<p>This converts a nutple <span class="docutils literal"><span class="pre">[c0,c1,...,cN]</span></span> into the polynomial
variable having these coefficients. Attention that the square
@@ -1255,8 +1312,27 @@ that we are actually referring to pre-declared variables in the sense
of <span class="docutils literal">\xintdefvar</span>.</p>
</div>
</div>
+<div class="section" id="lpol-nutple-expression">
+<span id="lpol"></span><h2><a class="toc-backref" href="#id45"><span class="docutils literal"><span class="pre">lpol(&lt;nutple</span> expression&gt;)</span></a></h2>
+<blockquote>
+<p>This converts a nutple <span class="docutils literal"><span class="pre">[cN,...,c1,c0]</span></span> into the polynomial
+variable having these coefficients, with leading coefficients coming
+first in the input. Attention that the square brackets are
+<strong>mandatory</strong>, except of course if the argument is actually an
+expression producing such a &quot;nutple&quot;.</p>
+<blockquote>
+<p>Currently, this process will not normalize the coefficients (such
+as reducing to lowest terms), it only trims out the leading zero
+coefficients.</p>
+<p><strong>NAME UNSTABLE</strong></p>
+</blockquote>
+<p>It can be used in <span class="docutils literal">\poldef</span> as an alternative input syntax, which
+is more efficient than using the algebraic notation with monomials.</p>
+<p>(new with <span class="docutils literal">0.8.1</span>, an empty nutple will cause breakage)</p>
+</blockquote>
+</div>
<div class="section" id="xinteval-pol-expr">
-<h2><a class="toc-backref" href="#id51"><span class="docutils literal"><span class="pre">\xinteval{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<h2><a class="toc-backref" href="#id46"><span class="docutils literal"><span class="pre">\xinteval{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
<p>This is documented here for lack of a better place: it evaluates the
polynomial expression then outputs the &quot;string&quot; <span class="docutils literal"><span class="pre">pol([c0,</span> c1, <span class="pre">...,</span> cN])</span>
@@ -1279,7 +1355,7 @@ This example can also be done as
</blockquote>
</div>
<div class="section" id="evalp-pol-expr-pol-expr">
-<h2><a class="toc-backref" href="#id52"><span class="docutils literal"><span class="pre">evalp(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. expr&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id47"><span class="docutils literal"><span class="pre">evalp(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. expr&gt;)</span></a></h2>
<blockquote>
<p>Evaluates the first argument as a polynomial function of the
second. Usually the second argument will be scalar, but this is not
@@ -1313,7 +1389,7 @@ though, as is amply demonstrated these days.</p>
</blockquote>
</div>
<div class="section" id="deg-pol-expr">
-<h2><a class="toc-backref" href="#id53"><span class="docutils literal"><span class="pre">deg(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id48"><span class="docutils literal"><span class="pre">deg(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>Computes the degree.</p>
</blockquote>
@@ -1326,7 +1402,7 @@ and <span class="docutils literal"><span class="pre">deg(P)&lt;=0</span></span>
</div>
</div>
<div class="section" id="coeffs-pol-expr">
-<h2><a class="toc-backref" href="#id54"><span class="docutils literal"><span class="pre">coeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id49"><span class="docutils literal"><span class="pre">coeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>Produces the nutple <span class="docutils literal"><span class="pre">[c0,c1,...,cN]</span></span> of coefficients. The highest
degree coefficient is always non zero (except for the zero
@@ -1339,27 +1415,44 @@ will be added to <a class="reference external" href="http://www.ctan.org/pkg/xin
</blockquote>
</blockquote>
</div>
+<div class="section" id="lcoeffs-pol-expr">
+<span id="lcoeffs"></span><h2><a class="toc-backref" href="#id50"><span class="docutils literal"><span class="pre">lcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<blockquote>
+<p>Produces the nutple <span class="docutils literal"><span class="pre">[cN,....,c1,c0]</span></span> of coefficients, starting
+with the highest degree coefficient.</p>
+<p>(new with <span class="docutils literal">0.8.1</span>)</p>
+</blockquote>
+</div>
<div class="section" id="coeff-pol-expr-num-expr">
-<h2><a class="toc-backref" href="#id55"><span class="docutils literal"><span class="pre">coeff(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;num. <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id51"><span class="docutils literal"><span class="pre">coeff(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;num. <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
-<p>As expected. Produces zero if <span class="docutils literal">n</span> is negative or higher than the
-degree.</p>
+<p>As expected. Produces zero if the numerical index is negative or
+higher than the degree.</p>
<blockquote>
-<p><strong>name and syntax unstable</strong></p>
-<p>I am hesitating with <span class="docutils literal">coeff(n,pol)</span> syntax and also perhaps
-using <span class="docutils literal">polcoeff()</span> in order to avoid having to overload
-<span class="docutils literal">coeff()</span> when matrix type will be added to <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>.</p>
+<p><strong>name, syntax and output unstable</strong></p>
+<p>I am hesitating with <span class="docutils literal">coeff(n,pol)</span> syntax and also perhaps using
+<span class="docutils literal">polcoeff()</span> in order to avoid having to overload <span class="docutils literal">coeff()</span>
+when matrix type will be added to <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>.</p>
+<p>The current behaviour is at odds with legacy
+<a class="reference internal" href="#polnthcoeff-polname-index">\PolNthCoeff{&lt;polname&gt;}{&lt;index&gt;}</a> regarding negative indices.
+Accessing leading or sub-leading coefficients can be done with
+other syntax, see <a class="reference internal" href="#lc-pol-expr">lc(&lt;pol. expr.&gt;)</a>, and in some contexts it
+is useful to be able to rely on the fact that coefficients with
+negative indices do vanish, so I am for time being maintaining this.</p>
</blockquote>
</blockquote>
</div>
-<div class="section" id="lcoeff-pol-expr">
-<h2><a class="toc-backref" href="#id56"><span class="docutils literal"><span class="pre">lcoeff(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<div class="section" id="lc-pol-expr">
+<span id="lc"></span><h2><a class="toc-backref" href="#id52"><span class="docutils literal"><span class="pre">lc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
-<p>The leading coefficient.</p>
+<p>The leading coefficient. The same result can be obtained from
+<span class="docutils literal"><span class="pre">coeffs(pol)[-1]</span></span>, which shows also how to generalize to access
+sub-leading coefficients. See the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> documentation for
+Python-like indexing syntax.</p>
</blockquote>
</div>
<div class="section" id="monicpart-pol-expr">
-<h2><a class="toc-backref" href="#id57"><span class="docutils literal"><span class="pre">monicpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id53"><span class="docutils literal"><span class="pre">monicpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>Divides by the leading coefficient, except that <span class="docutils literal"><span class="pre">monicpart(0)==0</span></span>.</p>
<blockquote>
@@ -1373,24 +1466,30 @@ efficiency of multiplication.</p>
</blockquote>
</blockquote>
</div>
-<div class="section" id="icontent-pol-expr">
-<h2><a class="toc-backref" href="#id58"><span class="docutils literal"><span class="pre">icontent(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<div class="section" id="cont-pol-expr">
+<span id="cont"></span><h2><a class="toc-backref" href="#id54"><span class="docutils literal"><span class="pre">cont(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
-<p>The gcd of the (possibly fractional) polynomial coefficients. It is
-always produced as an irreducible (non-negative) fraction. According
-to Gauss theorem the content of a product is the product of the
-contents.</p>
+<p>The (fractional) greatest common divisor of the polynomial
+coefficients. It is always produced as an irreducible (non-negative)
+fraction. According to Gauss theorem the content of a product is the
+product of the contents.</p>
<blockquote>
-<p><strong>name unstable</strong></p>
-<p>Some hesitation with using <span class="docutils literal">content()</span> rather.</p>
+<p><strong>name and syntax unstable</strong></p>
+<p>At <span class="docutils literal">0.8</span> it was created as <span class="docutils literal">icontent()</span> to match the legacy
+macro <a class="reference internal" href="#policontent">\PolIContent</a>, whose name in 2018 was
+chosen in relation to Maple's function <span class="docutils literal">icontent()</span>, possibly
+because at that time I had not seen that Maple also had a
+<span class="docutils literal">content()</span> function. Name changed at <span class="docutils literal">0.8.1</span>.</p>
+<p>It will change syntax if in future multivariate polynomials are
+supported, and <span class="docutils literal">icontent()</span> will then make a come-back.</p>
</blockquote>
</blockquote>
</div>
<div class="section" id="primpart-pol-expr">
-<h2><a class="toc-backref" href="#id59"><span class="docutils literal"><span class="pre">primpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id55"><span class="docutils literal"><span class="pre">primpart(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The quotient (except for the zero polynomial) by
-<span class="docutils literal"><span class="pre">icontent(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span>. This is thus a polynomial with
+<span class="docutils literal"><span class="pre">cont(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span>. This is thus a polynomial with
integer coefficients having <span class="docutils literal">1</span> as greatest common divisor. The
sign of the leading coefficient is the same as in the original.</p>
<p>And <span class="docutils literal"><span class="pre">primpart(0)==0</span></span>.</p>
@@ -1399,7 +1498,7 @@ into a power of ten exponent part, in the internal representation.</p>
</blockquote>
</div>
<div class="section" id="quorem-pol-expr-pol-expr">
-<h2><a class="toc-backref" href="#id60"><span class="docutils literal"><span class="pre">quorem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id56"><span class="docutils literal"><span class="pre">quorem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>Produces a nutple <span class="docutils literal">[Q,R]</span> with <span class="docutils literal">Q</span> the euclidean quotient and
<span class="docutils literal">R</span> the remainder.</p>
@@ -1410,14 +1509,14 @@ into a power of ten exponent part, in the internal representation.</p>
</blockquote>
</div>
<div class="section" id="quo-pol-expr-pol-expr">
-<h2><a class="toc-backref" href="#id61"><span class="docutils literal"><span class="pre">quo(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id57"><span class="docutils literal"><span class="pre">quo(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The euclidean quotient.</p>
<p>The deprecated <span class="docutils literal">pol1/pol2</span> syntax computes the same polynomial.</p>
</blockquote>
</div>
<div class="section" id="rem-pol-expr-pol-expr">
-<h2><a class="toc-backref" href="#id62"><span class="docutils literal"><span class="pre">rem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id58"><span class="docutils literal"><span class="pre">rem(&lt;pol.</span> <span class="pre">expr.&gt;,</span> &lt;pol. <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The euclidean remainder. If <span class="docutils literal">pol2</span> is a (non-zero) scalar, this is
zero.</p>
@@ -1429,7 +1528,7 @@ even in that case.</p>
</blockquote>
</div>
<div class="section" id="prem-pol-expr-1-pol-expr-2">
-<span id="prem"></span><h2><a class="toc-backref" href="#id63"><span class="docutils literal"><span class="pre">prem(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
+<span id="prem"></span><h2><a class="toc-backref" href="#id59"><span class="docutils literal"><span class="pre">prem(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
<blockquote>
<p>Produces a nutple <span class="docutils literal">[m, spR]</span> where <span class="docutils literal">spR</span> is the (special) pseudo
Euclidean remainder. Its description is:</p>
@@ -1477,7 +1576,7 @@ remainder. This diverges from Maple's function with the same name.</p>
</blockquote>
</div>
<div class="section" id="divmod-pol-expr-1-pol-expr-2">
-<h2><a class="toc-backref" href="#id64"><span class="docutils literal"><span class="pre">divmod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id60"><span class="docutils literal"><span class="pre">divmod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
<blockquote>
<p>Overloads the scalar <span class="docutils literal">divmod()</span> and associates it with the
experimental <span class="docutils literal">//</span> and <span class="docutils literal">/:</span> as extended to the polynomial type.</p>
@@ -1490,7 +1589,7 @@ non constant polynomials, this is the same as <span class="docutils literal">quo
</blockquote>
</div>
<div class="section" id="mod-pol-expr-1-pol-expr-2">
-<h2><a class="toc-backref" href="#id65"><span class="docutils literal"><span class="pre">mod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id61"><span class="docutils literal"><span class="pre">mod(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
<blockquote>
<p>The <span class="docutils literal">R</span> of the <span class="docutils literal">divmod()</span> output. Same as <span class="docutils literal">R</span> of <span class="docutils literal">quorem()</span>
when the second argument <span class="docutils literal">pol2</span> is of degree at least one.</p>
@@ -1500,7 +1599,7 @@ when the second argument <span class="docutils literal">pol2</span> is of degree
</blockquote>
</div>
<div class="section" id="polgcd-pol-expr-1-pol-expr-2">
-<h2><a class="toc-backref" href="#id66"><span class="docutils literal"><span class="pre">polgcd(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;, <span class="pre">...)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id62"><span class="docutils literal"><span class="pre">polgcd(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;, <span class="pre">...)</span></span></a></h2>
<blockquote>
<p>Evaluates to the greatest common polynomial divisor of all the
polynomial inputs. The output is a <strong>primitive</strong> (in particular,
@@ -1541,7 +1640,7 @@ polynomial, as one can always apply <span class="docutils literal">monicpart()</
</blockquote>
</div>
<div class="section" id="resultant-pol-expr-1-pol-expr-2">
-<h2><a class="toc-backref" href="#id67"><span class="docutils literal"><span class="pre">resultant(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id63"><span class="docutils literal"><span class="pre">resultant(&lt;pol.</span> expr. 1&gt;, &lt;pol. expr. 2&gt;)</span></a></h2>
<blockquote>
<p>The resultant.</p>
<blockquote>
@@ -1550,7 +1649,7 @@ polynomial, as one can always apply <span class="docutils literal">monicpart()</
</blockquote>
</div>
<div class="section" id="disc-pol-expr">
-<h2><a class="toc-backref" href="#id68"><span class="docutils literal"><span class="pre">disc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id64"><span class="docutils literal"><span class="pre">disc(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The discriminant.</p>
<blockquote>
@@ -1559,7 +1658,7 @@ polynomial, as one can always apply <span class="docutils literal">monicpart()</
</blockquote>
</div>
<div class="section" id="polpowmod-pol-expr-1-num-expr-pol-expr-2">
-<h2><a class="toc-backref" href="#id69"><span class="docutils literal"><span class="pre">polpowmod(&lt;pol.</span> expr. 1&gt;, &lt;num. <span class="pre">expr.&gt;,</span> &lt;pol. expr. 2&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id65"><span class="docutils literal"><span class="pre">polpowmod(&lt;pol.</span> expr. 1&gt;, &lt;num. <span class="pre">expr.&gt;,</span> &lt;pol. expr. 2&gt;)</span></a></h2>
<blockquote>
<p>Modular exponentiation: <span class="docutils literal">mod(pol1^N, pol2)</span> in a more efficient
manner than first computing <span class="docutils literal">pol1^N</span> then reducing modulo <span class="docutils literal">pol2</span>.</p>
@@ -1595,7 +1694,7 @@ pol([1, 0, 0, 0, 5, 4, 0, 0, 0, 0, 6, 0, 0, 0, 0, 4, 5, 0, 0, 0, 1])</pre>
</blockquote>
</div>
<div class="section" id="rdcoeffs-pol-expr">
-<h2><a class="toc-backref" href="#id70"><span class="docutils literal"><span class="pre">rdcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id66"><span class="docutils literal"><span class="pre">rdcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>This operates on the internal representation of the coefficients,
reducing them to lowest terms.</p>
@@ -1605,7 +1704,7 @@ reducing them to lowest terms.</p>
</blockquote>
</div>
<div class="section" id="rdzcoeffs-pol-expr">
-<h2><a class="toc-backref" href="#id71"><span class="docutils literal"><span class="pre">rdzcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id67"><span class="docutils literal"><span class="pre">rdzcoeffs(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>This operates on the internal representation of the coefficients,
reducing them to lowest terms then extracting from numerator
@@ -1619,7 +1718,7 @@ computations.</p>
</blockquote>
</div>
<div class="section" id="diff1-pol-expr">
-<h2><a class="toc-backref" href="#id72"><span class="docutils literal"><span class="pre">diff1(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id68"><span class="docutils literal"><span class="pre">diff1(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The first derivative.</p>
<blockquote>
@@ -1630,7 +1729,7 @@ respect to a first variable.</p>
</blockquote>
</div>
<div class="section" id="diff2-pol-expr">
-<h2><a class="toc-backref" href="#id73"><span class="docutils literal"><span class="pre">diff2(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
+<h2><a class="toc-backref" href="#id69"><span class="docutils literal"><span class="pre">diff2(&lt;pol.</span> <span class="pre">expr.&gt;)</span></span></a></h2>
<blockquote>
<p>The second derivative.</p>
<blockquote>
@@ -1641,7 +1740,7 @@ respect to a second variable.</p>
</blockquote>
</div>
<div class="section" id="diffn-pol-expr-p-num-expr-n">
-<h2><a class="toc-backref" href="#id74"><span class="docutils literal"><span class="pre">diffn(&lt;pol.</span> expr. P&gt;, &lt;num. expr. n&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id70"><span class="docutils literal"><span class="pre">diffn(&lt;pol.</span> expr. P&gt;, &lt;num. expr. n&gt;)</span></a></h2>
<blockquote>
<p>The <span class="docutils literal">n</span>th derivative of <span class="docutils literal">P</span>. For <span class="docutils literal">n&lt;0</span> computes iterated primitives
vanishing at the origin.</p>
@@ -1653,13 +1752,13 @@ vanishing at the origin.</p>
</blockquote>
</div>
<div class="section" id="antider-pol-expr-p">
-<h2><a class="toc-backref" href="#id75"><span class="docutils literal"><span class="pre">antider(&lt;pol.</span> expr. P&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id71"><span class="docutils literal"><span class="pre">antider(&lt;pol.</span> expr. P&gt;)</span></a></h2>
<blockquote>
<p>The primitive of <span class="docutils literal">P</span> with no constant term. Same as <span class="docutils literal"><span class="pre">diffn(P,-1)</span></span>.</p>
</blockquote>
</div>
<div class="section" id="intfrom-pol-expr-p-pol-expr-c">
-<h2><a class="toc-backref" href="#id76"><span class="docutils literal"><span class="pre">intfrom(&lt;pol.</span> expr. P&gt;, &lt;pol. expr. c&gt;)</span></a></h2>
+<h2><a class="toc-backref" href="#id72"><span class="docutils literal"><span class="pre">intfrom(&lt;pol.</span> expr. P&gt;, &lt;pol. expr. c&gt;)</span></a></h2>
<blockquote>
<p>The primitive of <span class="docutils literal">P</span> vanishing at <span class="docutils literal">c</span>, i.e. <span class="docutils literal">\int_c^x P(t)dt</span>.</p>
<p>Also <span class="docutils literal">c</span> can be a polynomial... so if <span class="docutils literal">c</span> is monomial <span class="docutils literal">x</span>
@@ -1673,7 +1772,7 @@ maintaining this feature whose interest appears dubious.</p>
</blockquote>
</div>
<div class="section" id="integral-pol-expr-p-pol-expr-a-pol-expr-b">
-<h2><a class="toc-backref" href="#id77"><span class="docutils literal"><span class="pre">integral(&lt;pol.</span> expr. P&gt;, [&lt;pol. expr. a&gt;, &lt;pol. expr. <span class="pre">b&gt;])</span></span></a></h2>
+<h2><a class="toc-backref" href="#id73"><span class="docutils literal"><span class="pre">integral(&lt;pol.</span> expr. P&gt;, [&lt;pol. expr. a&gt;, &lt;pol. expr. <span class="pre">b&gt;])</span></span></a></h2>
<blockquote>
<p><span class="docutils literal">\int_a^b P(t)dt</span>.</p>
<p>The brackets here are not denoting an optional argument
@@ -1692,7 +1791,7 @@ overhead to the pure scalar case ?</p>
</div>
</div>
<div class="section" id="examples-of-localization-of-roots">
-<h1><a class="toc-backref" href="#id78">Examples of localization of roots</a></h1>
+<h1><a class="toc-backref" href="#id74">Examples of localization of roots</a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of <span class="docutils literal">0.8</span>, <span class="docutils literal">polexpr</span> is usable with Plain TeX and not only with
@@ -1701,6 +1800,19 @@ syntax which (at least at time of writing, March 2021) works in both.</p>
<p>This is done in order for the examples to be easy to copy-paste to
documents using either macro format.</p>
</div>
+<p>This (slightly over-extended) section gives various examples of usage of
+the package macros such as <a class="reference internal" href="#poltosturm">\PolToSturm</a>, <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a>
+and <a class="reference internal" href="#polprintintervals">\PolPrintIntervals</a> for root localization, which exist since
+release <span class="docutils literal">0.4</span> (2018/02/16). The capacity to find all rational roots
+exactly was added at <span class="docutils literal">0.7.2</span> (2018/12/09).</p>
+<p>The examples demonstrate that the package can find all real roots to
+arbitrary precision, find the multiplicities of real roots, and find
+exactly all rational roots.</p>
+<p>Perhaps future releases will implement other approaches, which are known
+to be generically computationally more efficient, at least in high
+degrees, than the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm theorem</a> based approach. This is not
+immediate priority though (perhaps support of multivariate polynomials
+would be more important feature; or localization of complex roots).</p>
<ul>
<li><p>To make printed decimal numbers more enjoyable than via
<span class="docutils literal">\xintSignedFrac</span> (or <span class="docutils literal">\xintSignedFwOver</span> with Plain):</p>
@@ -1715,8 +1827,21 @@ that one can also do:</p>
</li>
<li><p>For extra info in log file use <span class="docutils literal">\xintverbosetrue</span>.</p></li>
</ul>
+<div class="admonition warning">
+<p class="admonition-title">Warning</p>
+<p>Package macros related to root localization create (user-level) new
+polynomials, or numeric variables, via a naming scheme which
+postfixes a root name <span class="docutils literal">&lt;sturmname&gt;</span> in various ways (see
+<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</a> and
+<a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a>). It is thus advisable to
+keep the <span class="docutils literal">&lt;sturmname&gt;</span> name-space separate from the one used to
+name polynomial or scalar variables.</p>
+<p>Regrettably all examples here use the condemnable
+<span class="docutils literal"><span class="pre">\PolToSturm{f}{f}</span></span> practice which fuses the name-spaces. This can
+lead to problems if one is not aware of the consequances.</p>
+</div>
<div class="section" id="a-typical-example">
-<h2><a class="toc-backref" href="#id79">A typical example</a></h2>
+<h2><a class="toc-backref" href="#id75">A typical example</a></h2>
<p>In this example the polynomial is square-free.</p>
<pre class="literal-block">\poldef f(x) := x^7 - x^6 - 2x + 1;
@@ -1756,9 +1881,9 @@ The more mathematically advanced among our dear readers will be able
to give the exact value for $X_2$!</pre>
</div>
<div class="section" id="a-degree-four-polynomial-with-nearby-roots">
-<h2><a class="toc-backref" href="#id80">A degree four polynomial with nearby roots</a></h2>
+<h2><a class="toc-backref" href="#id76">A degree four polynomial with nearby roots</a></h2>
<p>Notice that this example is a bit outdated as <span class="docutils literal">0.7</span> release has
-added <span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></span> which would find exactly
+added <span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</span></span> which would find exactly
the roots. The steps here retain their interest when one is interested
in finding isolating intervals for example to prepare some demonstration
of dichotomy method.</p>
@@ -1782,7 +1907,7 @@ of dichotomy method.</p>
% of course finds here all roots exactly</pre>
</div>
<div class="section" id="the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">
-<h2><a class="toc-backref" href="#id81">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></h2>
+<h2><a class="toc-backref" href="#id77">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple roots</a></h2>
<pre class="literal-block">% define a user command (xinttools is loaded automatically by polexpr)
\def\showmultiplicities#1{% #1 = &quot;sturmname&quot;
\xintFor* ##1 in {\xintSeq{1}{\PolSturmNbOfIsolatedZeros{#1}}}\do{%
@@ -1842,7 +1967,7 @@ The multiplicity is 1 for the root such that 0.9991447980 &lt; x &lt; 0.99914479
The multiplicity is 1 for the root such that 0.9997663986 &lt; x &lt; 0.9997663987</pre>
</div>
<div class="section" id="a-degree-five-polynomial-with-three-rational-roots">
-<h2><a class="toc-backref" href="#id82">A degree five polynomial with three rational roots</a></h2>
+<h2><a class="toc-backref" href="#id78">A degree five polynomial with three rational roots</a></h2>
<pre class="literal-block">\poldef Q(x) := 1581755751184441 x^5
-14907697165025339 x^4
+48415668972339336 x^3
@@ -1874,7 +1999,7 @@ Z_2 = 3.14159265358979340254...
Z_3 = 3.14159292035398230088...</pre>
</div>
<div class="section" id="a-mignotte-type-polynomial">
-<h2><a class="toc-backref" href="#id83">A Mignotte type polynomial</a></h2>
+<h2><a class="toc-backref" href="#id79">A Mignotte type polynomial</a></h2>
<pre class="literal-block">\PolDef{P}{x^10 - (10x-1)^2}%
\PolTypeset{P} % prints it in expanded form
\PolToSturm{P}{P} % we can use same prefix for Sturm chain
@@ -1897,7 +2022,7 @@ $$\PolSturmIsolatedZeroLeft{P}{2}&lt;Z_2&lt;\PolSturmIsolatedZeroRight{P}{2}$$</
<pre class="literal-block">0.09999900004999650028 &lt; Z_2 &lt; 0.09999900004999650029</pre>
</div>
<div class="section" id="the-wilkinson-polynomial">
-<h2><a class="toc-backref" href="#id84">The Wilkinson polynomial</a></h2>
+<h2><a class="toc-backref" href="#id80">The Wilkinson polynomial</a></h2>
<p>See <a class="reference external" href="https://en.wikipedia.org/wiki/Wilkinson%27s_polynomial">Wilkinson polynomial</a>.</p>
<pre class="literal-block">%\xintverbosetrue % for the curious...
@@ -1967,7 +2092,7 @@ Z_9 = 8.9172502485...
Z_10 = 20.8469081014...</pre>
</div>
<div class="section" id="the-second-wilkinson-polynomial">
-<h2><a class="toc-backref" href="#id85">The second Wilkinson polynomial</a></h2>
+<h2><a class="toc-backref" href="#id81">The second Wilkinson polynomial</a></h2>
<pre class="literal-block">\poldef f(x) := mul(x - 2^-i, i = 1..20);
%\PolTypeset{f}
@@ -2006,7 +2131,7 @@ fractions and they use <span class="docutils literal">\xintIrr</span> before sto
This may evolve in future.</p>
</div>
<div class="section" id="the-degree-41-polynomial-with-2-1-9-1-8-0-0-1-1-9-2-as-roots">
-<h2><a class="toc-backref" href="#id86">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></h2>
+<h2><a class="toc-backref" href="#id82">The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots</a></h2>
<pre class="literal-block">\PolDef{P}{mul((x-i*1e-1), i=-20..20)}% i/10 is same but less efficient</pre>
<p>In the defining expression we could have used <span class="docutils literal">i/10</span> but this gives
less efficient internal form for the coefficients (the <span class="docutils literal">10</span>'s end up
@@ -2058,18 +2183,19 @@ optional argument keeping the same.</p>
</div>
</div>
<div class="section" id="roots-of-chebyshev-polynomials">
-<h2><a class="toc-backref" href="#id87">Roots of Chebyshev polynomials</a></h2>
-<pre class="literal-block">\newcount\mycount
-\poldef T_0(x) := 1;
+<h2><a class="toc-backref" href="#id83">Roots of Chebyshev polynomials</a></h2>
+<pre class="literal-block">\poldef T_0(x) := 1;
\poldef T_1(x) := x;
-\mycount 2
+\catcode`&#64; 11
+\count&#64; 2
\xintloop
- \poldef T_\the\mycount(x) :=
- 2x*T_\the\numexpr\mycount-1(x)
- - T_\the\numexpr\mycount-2(x);
-\ifnum\mycount&lt;15
-\advance\mycount 1
+ \poldef T_\the\count&#64;(x) :=
+ 2x*T_\the\numexpr\count&#64;-1\relax
+ - T_\the\numexpr\count&#64;-2\relax;
+\ifnum\count&#64;&lt;15
+\advance\count&#64; 1
\repeat
+\catcode`&#64; 12
$$T_{15} = \PolTypeset[X]{T_15}$$
\PolToSturm{T_15}{T_15}
@@ -2079,7 +2205,7 @@ $$T_{15} = \PolTypeset[X]{T_15}$$
</div>
</div>
<div class="section" id="non-expandable-macros">
-<h1><a class="toc-backref" href="#id88">Non-expandable macros</a></h1>
+<h1><a class="toc-backref" href="#id84">Non-expandable macros</a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>At <span class="docutils literal">0.8</span> <span class="docutils literal">polexpr</span> is usable with Plain TeX and not only with
@@ -2088,24 +2214,24 @@ such as <span class="docutils literal">\renewcommand</span>. Convert to TeX pri
if testing with a non LaTeX macro format.</p>
</div>
<div class="section" id="poldef-polname-letter-expression-using-the-letter-as-indeterminate">
-<span id="poldef"></span><h2><a class="toc-backref" href="#id89"><span class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression using the letter as indeterminate;</span></a></h2>
+<span id="poldef"></span><h2><a class="toc-backref" href="#id85"><span class="docutils literal">\poldef <span class="pre">polname(letter):=</span> expression using the letter as indeterminate;</span></a></h2>
<blockquote>
<p>This evaluates the <em>polynomial expression</em> and stores the
coefficients in a private structure accessible later via other
-package macros, when used with argument the chosen <span class="docutils literal">polname</span>. Of
-course the <em>expression</em> can use other previously defined
-polynomials.</p>
+package macros, used with argument <span class="docutils literal">polname</span>. Of course the
+<em>expression</em> can make use of previously defined polynomials.</p>
<p>Polynomial names must start with a letter and are constituted of
letters, digits, underscores and the right tick <span class="docutils literal">'</span>.</p>
-<p>The whole <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> syntax is authorized:</p>
-<pre class="literal-block">\poldef mypol(z) := add((-1)^i z^(2i+1)/(2i+1)!, i = 0..10);</pre>
+<p>The whole <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> syntax is authorized, as long as the final
+result is of polynomial type:</p>
+<pre class="literal-block">\poldef polname(z) := add((-1)^i z^(2i+1)/(2i+1)!, i = 0..10);</pre>
<p>With fractional coefficients, beware the <a class="reference internal" href="#warningtacit">tacit multiplication issue</a>.</p>
<p>Furthermore:</p>
<ul class="simple">
-<li><p>a variable <span class="docutils literal">mypol</span> is defined which can be used in <span class="docutils literal">\poldef</span>
+<li><p>a variable <span class="docutils literal">polname</span> is defined which can be used in <span class="docutils literal">\poldef</span>
as well as in <span class="docutils literal">\xinteval</span> for algebraic computations or as
argument to polynomial aware functions,</p></li>
-<li><p>a function <span class="docutils literal">mypol()</span> is defined which can be used in <span class="docutils literal">\poldef</span>
+<li><p>a function <span class="docutils literal">polname()</span> is defined which can be used in <span class="docutils literal">\poldef</span>
as well as in <span class="docutils literal">\xinteval</span>. It accepts there as argument scalars
and also other polynomials (via their names, thanks to previous
item).</p></li>
@@ -2118,13 +2244,12 @@ names as argument.</p>
internal data structure on which the package macros operate)
associated to it is indistinguishable from a scalar, it is actually
a scalar and has lost all traces from its origins as a polynomial
-(so for example can be used as argument to the <span class="docutils literal">cos()</span> function).
-<strong>THIS MAY CHANGE</strong></p>
+(so for example can be used as argument to the <span class="docutils literal">cos()</span> function).</p>
<p>The <em>function</em> on the other hand remains a one-argument function,
which simply has a constant value.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p>The function <span class="docutils literal">mypol()</span> is defined <strong>only</strong> for
+<p>The function <span class="docutils literal">polname()</span> is defined <strong>only</strong> for
<span class="docutils literal"><span class="pre">\xintexpr/\xinteval</span></span>
context. It will be unknown to <span class="docutils literal">\xintfloateval</span>.</p>
<p>Worse, a
@@ -2133,9 +2258,8 @@ be let undefined again, to avoid hard to debug mismatches between
exact and floating point polynomials. This also applies when the
polynomial is produced not via <span class="docutils literal">\poldef</span> or <span class="docutils literal">\PolDef</span> but
as result of usage of the other package macros.</p>
-<p>See <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a> to generate a <strong>function</strong>
-usable in <span class="docutils literal">\xintfloateval</span>. Such a function can only be
-used with scalar input, see next warning.</p>
+<p>See <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{&lt;polname&gt;}</a> to generate a <strong>function</strong>
+usable in <span class="docutils literal">\xintfloateval</span>.</p>
</div>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
@@ -2145,13 +2269,12 @@ not polynomial-aware, and the polynomial specific functions such
as <span class="docutils literal">deg()</span> are only defined for usage inside <span class="docutils literal">\xintexpr</span>.</p>
<p>In short, currently polynomials defined via <span class="docutils literal">polexpr</span> can
be used in floating point context only for numerical evaluations,
-via <strong>functions</strong> obtained from <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>
+via <strong>functions</strong> obtained from <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{&lt;polname&gt;}</a>
usage.</p>
<p>Changes to the original polynomial via package macros are not
automatically mapped to the numerical floating point evaluator
which must be manually updated as necessary when the original
rational coefficient polynomial is modified.</p>
-<p><strong>THIS MAY CHANGE</strong></p>
</div>
<p>The original expression is lost after parsing, and in particular the
package provides no way to typeset it (of course the package
@@ -2159,111 +2282,35 @@ provides macros to typeset the computed polynomial). Typesetting
the original expression has to be done manually, if needed.</p>
</blockquote>
</div>
-<div class="section" id="poldef-letter-polname-expression-using-the-letter-as-indeterminate">
-<span id="id8"></span><h2><a class="toc-backref" href="#id90"><span class="docutils literal"><span class="pre">\PolDef[letter]{polname}{expression</span> using the letter as indeterminate}</span></a></h2>
+<div class="section" id="poldef-letter-polname-expr-using-the-letter-as-indeterminate">
+<span id="id8"></span><h2><a class="toc-backref" href="#id86"><span class="docutils literal"><span class="pre">\PolDef[&lt;letter&gt;]{&lt;polname&gt;}{&lt;expr.</span> using the letter as indeterminate&gt;}</span></a></h2>
<blockquote>
<p>Does the same as <a class="reference internal" href="#poldef">\poldef</a> in an undelimited macro
-format (thus avoiding potential problems with the catcode of the
-semi-colon in presence of some packages.) In absence of the
-<span class="docutils literal">[letter]</span> optional argument, the variable is assumed to be <span class="docutils literal">x</span>.</p>
+format, the main interest is to avoid potential problems with the
+catcode of the semi-colon in presence of some packages. In absence
+of a <span class="docutils literal">[&lt;letter&gt;]</span> optional argument, the variable is assumed to be
+<span class="docutils literal">x</span>.</p>
</blockquote>
</div>
<div class="section" id="polgenfloatvariant-polname">
-<span id="polgenfloatvariant"></span><h2><a class="toc-backref" href="#id91"><span class="docutils literal">\PolGenFloatVariant{polname}</span></a></h2>
+<span id="polgenfloatvariant"></span><h2><a class="toc-backref" href="#id87"><span class="docutils literal"><span class="pre">\PolGenFloatVariant{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
-<p>Makes the polynomial also usable in the <span class="docutils literal">\xintfloatexpr</span> parser.
-It will therein evaluates via an Horner scheme with coefficients
-already pre-rounded to the float precision.</p>
+<p>Makes the polynomial also usable in the
+<span class="docutils literal"><span class="pre">\xintfloatexpr/\xintfloateval</span></span> parser. It will therein evaluates
+via an Horner scheme using polynomial coefficients already
+pre-rounded to the float precision.</p>
<p>See also <a class="reference internal" href="#poltofloatexpr-pol-expr">\PolToFloatExpr{&lt;pol. expr.&gt;}</a>.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
<p>Any operation, for example generating the derivative polynomial,
-or dividing two polynomials or using the <span class="docutils literal">\PolLet</span>, <strong>must</strong> be
-followed by explicit usage of <span class="docutils literal">\PolGenFloatVariant{polname}</span> if
-the new polynomial is to be used in <span class="docutils literal">\xintfloateval</span> <strong>as a
-function</strong>.</p>
-</div>
-</blockquote>
-</div>
-<div class="section" id="pollet-polname-2-polname-1">
-<span id="pollet"></span><h2><a class="toc-backref" href="#id92"><span class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></span></a></h2>
-<blockquote>
-<p>Makes a copy of the already defined polynomial <span class="docutils literal">polname_1</span> to a
-new one <span class="docutils literal">polname_2</span>. Same effect as
-<span class="docutils literal"><span class="pre">\PolDef{polname_2}{polname_1(x)}</span></span> but with less overhead. The
-<span class="docutils literal">=</span> is optional.</p>
-</blockquote>
-</div>
-<div class="section" id="polgloballet-polname-2-polname-1">
-<span id="polgloballet"></span><h2><a class="toc-backref" href="#id93"><span class="docutils literal"><span class="pre">\PolGlobalLet{polname_2}={polname_1}</span></span></a></h2>
-<blockquote>
-<p>Acts globally.</p>
-</blockquote>
-</div>
-<div class="section" id="polassign-polname-toarray-macro">
-<span id="polassign"></span><h2><a class="toc-backref" href="#id94"><span class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></span></a></h2>
-<blockquote>
-<p>Defines a one-argument expandable macro <span class="docutils literal"><span class="pre">\macro{#1}</span></span> which expands
-to the (raw) #1th polynomial coefficient.</p>
-<ul class="simple">
-<li><p>Attention, coefficients here are indexed starting at 1.</p></li>
-<li><p>With #1=-1, -2, ..., <span class="docutils literal"><span class="pre">\macro{#1}</span></span> returns leading coefficients.</p></li>
-<li><p>With #1=0, returns the number of coefficients, i.e. <span class="docutils literal">1 + deg f</span>
-for non-zero polynomials.</p></li>
-<li><p>Out-of-range #1's return <span class="docutils literal">0/1[0]</span>.</p></li>
-</ul>
-<p>See also <a class="reference internal" href="#polnthcoeff-polname-number">\PolNthCoeff{polname}{number}</a>. The main difference is that
-with <span class="docutils literal">\PolAssign</span>, <span class="docutils literal">\macro</span> is made a prefix to <span class="docutils literal">1 + deg f</span>
-already defined (hidden to user) macros holding individually the
-coefficients but <a class="reference internal" href="#polnthcoeff-polname-number">\PolNthCoeff{polname}{number}</a> does each time the job
-to expandably recover the <span class="docutils literal">Nth</span> coefficient, and due to
-expandability can not store it in a macro for future usage (of course,
-it can be an argument in an <span class="docutils literal">\edef</span>.) The other difference
-is the shift by one in indexing, mentioned above (negative
-indices act the same in both.)</p>
-</blockquote>
-</div>
-<div class="section" id="polget-polname-fromarray-macro">
-<span id="polget"></span><h2><a class="toc-backref" href="#id95"><span class="docutils literal"><span class="pre">\PolGet{polname}\fromarray\macro</span></span></a></h2>
-<blockquote>
-<p>Does the converse operation to
-<span class="docutils literal"><span class="pre">\PolAssign{polname}\toarray\macro</span></span>. Each individual
-<span class="docutils literal">\macro{number}</span> gets expanded in an <span class="docutils literal">\edef</span> and then normalized
-via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <span class="docutils literal">\xintRaw</span>.</p>
-<p>The leading zeros are removed from the polynomial.</p>
-<p>(contrived) Example:</p>
-<pre class="literal-block">\xintAssignArray{1}{-2}{5}{-3}\to\foo
-\PolGet{f}\fromarray\foo</pre>
-<p>This will define <span class="docutils literal">f</span> as would have <span class="docutils literal">\poldef <span class="pre">f(x):=1-2x+5x^2-3x^3;</span></span>.</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>Prior to <span class="docutils literal">0.5</span>, coefficients were not normalized via
-<span class="docutils literal">\xintRaw</span> for internal storage.</p>
-</div>
-</blockquote>
-</div>
-<div class="section" id="polfromcsv-polname-csv">
-<span id="polfromcsv"></span><h2><a class="toc-backref" href="#id96"><span class="docutils literal"><span class="pre">\PolFromCSV{polname}{&lt;csv&gt;}</span></span></a></h2>
-<blockquote>
-<p>Defines a polynomial directly from the comma separated list of values
-(or a macro expanding to such a list) of its coefficients, the <em>first
-item</em> gives the constant term, the <em>last item</em> gives the leading
-coefficient, except if zero, then it is dropped (iteratively). List
-items are each expanded in an <span class="docutils literal">\edef</span> and then put into normalized
-form via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <span class="docutils literal">\xintRaw</span>.</p>
-<p>As leading zero coefficients are removed:</p>
-<pre class="literal-block">\PolFromCSV{f}{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}</pre>
-<p>defines the zero polynomial, which holds only one coefficient.</p>
-<p>See also expandable macro <a class="reference internal" href="#poltocsv-polname">\PolToCSV</a>.</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>Prior to <span class="docutils literal">0.5</span>, coefficients were not normalized via
-<span class="docutils literal">\xintRaw</span> for internal storage.</p>
+or dividing two polynomials or using the <span class="docutils literal">\PolLet</span>, must be
+followed by explicit usage of <span class="docutils literal"><span class="pre">\PolGenFloatVariant{&lt;polname&gt;}</span></span> if
+the new polynomial is to be used in <span class="docutils literal">\xintfloateval</span>.</p>
</div>
</blockquote>
</div>
<div class="section" id="poltypeset-pol-expr">
-<span id="poltypeset"></span><h2><a class="toc-backref" href="#id97"><span class="docutils literal"><span class="pre">\PolTypeset{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<span id="poltypeset"></span><h2><a class="toc-backref" href="#id88"><span class="docutils literal"><span class="pre">\PolTypeset{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
<p>Typesets in descending powers, switching to math mode if in text
mode, after evaluating the polynomial expression:</p>
@@ -2280,23 +2327,37 @@ can be re-defined for customization. Their default definitions are
expandable, but this is not a requirement.</p>
</blockquote>
<div class="section" id="poltypesetcmd-raw-coeff">
-<span id="poltypesetcmd"></span><h3><a class="toc-backref" href="#id98"><span class="docutils literal">\PolTypesetCmd{raw_coeff}</span></a></h3>
+<span id="poltypesetcmd"></span><h3><a class="toc-backref" href="#id89"><span class="docutils literal"><span class="pre">\PolTypesetCmd{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
-<p>Checks if the coefficient is <span class="docutils literal">1</span> or <span class="docutils literal"><span class="pre">-1</span></span> and then skips printing
-the <span class="docutils literal">1</span>, except for the constant term. Also it sets conditional
-<a class="reference internal" href="#polifcoeffisplusorminusone-a-b">\PolIfCoeffIsPlusOrMinusOne{A}{B}</a>.</p>
+<p>Its package definition checks if the coefficient is <span class="docutils literal">1</span> or <span class="docutils literal"><span class="pre">-1</span></span>
+and then skips printing the <span class="docutils literal">1</span>, except for the coefficient of
+degree zero. Also it sets the conditional deciding behaviour of
+<a class="reference internal" href="#polifcoeffisplusorminusone-t-f">\PolIfCoeffIsPlusOrMinusOne{T}{F}</a>.</p>
<p>The actual printing of the coefficients, when not equal to plus or
-minus one is handled by <a class="reference internal" href="#poltypesetone-raw-coeff">\PolTypesetOne{raw_coeff}</a>.</p>
+minus one, is handled by <a class="reference internal" href="#poltypesetone-raw-coeff">\PolTypesetOne{&lt;raw_coeff&gt;}</a>.</p>
</blockquote>
+<div class="section" id="polifcoeffisplusorminusone-t-f">
+<span id="polifcoeffisplusorminusone"></span><h4><a class="toc-backref" href="#id90"><span class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{T}{F}</span></span></a></h4>
+<blockquote>
+<p>This macro is a priori undefined.</p>
+<p>It is defined via the default <a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{&lt;raw_coeff&gt;}</a> to be
+used if needed in the execution of <a class="reference internal" href="#poltypesetmonomialcmd">\PolTypesetMonomialCmd</a>,
+e.g. to insert a <span class="docutils literal">\cdot</span> in front of <span class="docutils literal"><span class="pre">\PolVar^{\PolIndex}</span></span> if
+the coefficient is not plus or minus one.</p>
+<p>The macro will execute <span class="docutils literal">T</span> if the coefficient has been found to be
+plus or minus one, and <span class="docutils literal">F</span> if not. It chooses expandably between
+<span class="docutils literal">T</span> and <span class="docutils literal">F</span>.</p>
+</blockquote>
+</div>
</div>
<div class="section" id="poltypesetone-raw-coeff">
-<span id="poltypesetone"></span><h3><a class="toc-backref" href="#id99"><span class="docutils literal">\PolTypesetOne{raw_coeff}</span></a></h3>
+<span id="poltypesetone"></span><h3><a class="toc-backref" href="#id91"><span class="docutils literal"><span class="pre">\PolTypesetOne{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal">\xintSignedFrac</span> (LaTeX) or <span class="docutils literal">\xintSignedFwOver</span>
-(else). But these <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> very old legacy macros are a bit
-annoyin as they insist in exhibiting a power of ten rather than
+(else). But these <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> old legacy macros are a bit
+annoying as they insist in exhibiting a power of ten rather than
using simpler decimal notation.</p>
-<p>As alternative one can do things such as:</p>
+<p>As alternative, one can do definitions such as:</p>
<pre class="literal-block">\def\PolTypesetOne#1{\xintDecToString{\xintREZ{#1}}}
% or with LaTeX+siunitx for example
\renewcommand\PolTypesetOne[1]{\num{\xintPFloat[5]{#1}}}
@@ -2305,7 +2366,7 @@ using simpler decimal notation.</p>
</blockquote>
</div>
<div class="section" id="id9">
-<span id="poltypesetmonomialcmd"></span><h3><a class="toc-backref" href="#id100"><span class="docutils literal">\PolTypesetMonomialCmd</span></a></h3>
+<span id="poltypesetmonomialcmd"></span><h3><a class="toc-backref" href="#id92"><span class="docutils literal">\PolTypesetMonomialCmd</span></a></h3>
<blockquote>
<p>This decides how a monomial (in variable <span class="docutils literal">\PolVar</span> and with
exponent <span class="docutils literal">\PolIndex</span>) is to be printed. The default does nothing
@@ -2316,231 +2377,138 @@ for the constant term, <span class="docutils literal">\PolVar</span> for the fir
</blockquote>
</div>
<div class="section" id="poltypesetcmdprefix-raw-coeff">
-<span id="poltypesetcmdprefix"></span><h3><a class="toc-backref" href="#id101"><span class="docutils literal">\PolTypesetCmdPrefix{raw_coeff}</span></a></h3>
+<span id="poltypesetcmdprefix"></span><h3><a class="toc-backref" href="#id93"><span class="docutils literal"><span class="pre">\PolTypesetCmdPrefix{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to a <span class="docutils literal">+</span> if the <span class="docutils literal">raw_coeff</span> is zero or positive, and to
nothing if <span class="docutils literal">raw_coeff</span> is negative, as in latter case the
<span class="docutils literal">\xintSignedFrac</span> (or <span class="docutils literal">\xintSignedFwOver</span>) used by
-<a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{raw_coeff}</a> will put the <span class="docutils literal">-</span> sign in front of
+<a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{&lt;raw_coeff&gt;}</a> will put the <span class="docutils literal">-</span> sign in front of
the fraction (if it is a fraction) and this will thus serve as
separator in the typeset formula. Not used for the first term.</p>
</blockquote>
</div>
</div>
<div class="section" id="id11">
-<span id="id10"></span><h2><a class="toc-backref" href="#id102"><span class="docutils literal"><span class="pre">\PolTypeset*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<span id="id10"></span><h2><a class="toc-backref" href="#id94"><span class="docutils literal"><span class="pre">\PolTypeset*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
-<p>Typesets in ascending powers. Use e.g. <span class="docutils literal">[h]</span> optional argument
-(after the <span class="docutils literal">*</span>) to use letter <span class="docutils literal">h</span> rather than <span class="docutils literal">x</span>.</p>
+<p>Typesets in ascending powers. Use <span class="docutils literal">[&lt;letter&gt;]</span> optional argument
+(after the <span class="docutils literal">*</span>) to use another letter than <span class="docutils literal">x</span>.</p>
<p>Extended at <span class="docutils literal">0.8</span> to accept general expressions and not only
polynomial names. Redefine <a class="reference internal" href="#poltoexprinvar">\PolToExprInVar</a> to use in the
expression another letter than default <span class="docutils literal">x</span>.</p>
</blockquote>
</div>
-<div class="section" id="poldiff-polname-1-polname-2">
-<span id="poldiff"></span><h2><a class="toc-backref" href="#id103"><span class="docutils literal"><span class="pre">\PolDiff{polname_1}{polname_2}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_2</span> to the first derivative of <span class="docutils literal">polname_1</span>. It
-is allowed to issue <span class="docutils literal"><span class="pre">\PolDiff{f}{f}</span></span>, effectively replacing <span class="docutils literal">f</span>
-by <span class="docutils literal">f'</span>.</p>
-<p>Coefficients of the result <span class="docutils literal">polname_2</span> are irreducible fractions
-(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
-</blockquote>
-</div>
-<div class="section" id="poldiff-n-polname-1-polname-2">
-<span id="poldiff-n"></span><h2><a class="toc-backref" href="#id104"><span class="docutils literal"><span class="pre">\PolDiff[N]{polname_1}{polname_2}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_2</span> to the <span class="docutils literal">N</span>-th derivative of <span class="docutils literal">polname_1</span>.
-Identical arguments is allowed. With <span class="docutils literal">N=0</span>, same effect as
-<span class="docutils literal"><span class="pre">\PolLet{polname_2}={polname_1}</span></span>. With negative <span class="docutils literal">N</span>, switches to
-using <span class="docutils literal">\PolAntiDiff</span>.</p>
-</blockquote>
-</div>
-<div class="section" id="polantidiff-polname-1-polname-2">
-<span id="polantidiff"></span><h2><a class="toc-backref" href="#id105"><span class="docutils literal"><span class="pre">\PolAntiDiff{polname_1}{polname_2}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_2</span> to the primitive of <span class="docutils literal">polname_1</span> vanishing
-at zero.</p>
-<p>Coefficients of the result <span class="docutils literal">polname_2</span> are irreducible fractions
-(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
-</blockquote>
-</div>
-<div class="section" id="polantidiff-n-polname-1-polname-2">
-<span id="polantidiff-n"></span><h2><a class="toc-backref" href="#id106"><span class="docutils literal"><span class="pre">\PolAntiDiff[N]{polname_1}{polname_2}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_2</span> to the result of <span class="docutils literal">N</span> successive integrations on
-<span class="docutils literal">polname_1</span>. With negative <span class="docutils literal">N</span>, it switches to using <span class="docutils literal">\PolDiff</span>.</p>
-</blockquote>
-</div>
-<div class="section" id="poldivide-polname-1-polname-2-polname-q-polname-r">
-<span id="poldivide"></span><h2><a class="toc-backref" href="#id107"><span class="docutils literal"><span class="pre">\PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_Q</span> and <span class="docutils literal">polname_R</span> to be the quotient and
-remainder in the Euclidean division of <span class="docutils literal">polname_1</span> by
-<span class="docutils literal">polname_2</span>.</p>
-</blockquote>
-</div>
-<div class="section" id="polquo-polname-1-polname-2-polname-q">
-<span id="polquo"></span><h2><a class="toc-backref" href="#id108"><span class="docutils literal"><span class="pre">\PolQuo{polname_1}{polname_2}{polname_Q}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_Q</span> to be the quotient in the Euclidean division
-of <span class="docutils literal">polname_1</span> by <span class="docutils literal">polname_2</span>.</p>
-</blockquote>
-</div>
-<div class="section" id="polrem-polname-1-polname-2-polname-r">
-<span id="polrem"></span><h2><a class="toc-backref" href="#id109"><span class="docutils literal"><span class="pre">\PolRem{polname_1}{polname_2}{polname_R}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_R</span> to be the remainder in the Euclidean division
-of <span class="docutils literal">polname_1</span> by <span class="docutils literal">polname_2</span>.</p>
-</blockquote>
-</div>
-<div class="section" id="polgcd-polname-1-polname-2-polname-gcd">
-<span id="polgcd"></span><h2><a class="toc-backref" href="#id110"><span class="docutils literal"><span class="pre">\PolGCD{polname_1}{polname_2}{polname_GCD}</span></span></a></h2>
-<blockquote>
-<p>This sets <span class="docutils literal">polname_GCD</span> to be the (monic) GCD of the two first
-polynomials. It is a unitary polynomial except if both <span class="docutils literal">polname_1</span>
-and <span class="docutils literal">polname_2</span> vanish, then <span class="docutils literal">polname_GCD</span> is the zero
-polynomial.</p>
-</blockquote>
-</div>
<div class="section" id="non-expandable-macros-related-to-the-root-localization-routines">
-<h2><a class="toc-backref" href="#id111">Non-expandable macros related to the root localization routines</a></h2>
+<h2><a class="toc-backref" href="#id95">Non-expandable macros related to the root localization routines</a></h2>
+<p>As <a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</a> and
+<a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> and variants declare
+additional polynomial or scalar variables with names based on <span class="docutils literal">&lt;sturmname&gt;</span> as
+prefix, it is advisable to keep the <span class="docutils literal">&lt;sturmname&gt;</span> namespace separate from
+the one applying to <span class="docutils literal">\xintexpr</span> variables generally, or to polynomials.</p>
<div class="section" id="poltosturm-polname-sturmname">
-<span id="poltosturm"></span><h3><a class="toc-backref" href="#id112"><span class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></span></a></h3>
-<blockquote>
-<p>With <span class="docutils literal">polname</span> being for example <span class="docutils literal">P</span>, the macro starts by
-computing polynomials <span class="docutils literal">P</span> and <span class="docutils literal">P'</span>, then computes the (opposite
-of the) remainder in euclidean division, iteratively.</p>
-<p>The last non-zero remainder <span class="docutils literal">P_N_</span> (where <span class="docutils literal">N</span> is obtainable as
-<a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a>) is up to a factor
-the GCD of <span class="docutils literal">P</span> and <span class="docutils literal">P'</span> hence it is a constant if and only if
-<span class="docutils literal">P</span> is square-free.</p>
+<span id="poltosturm"></span><h3><a class="toc-backref" href="#id96"><span class="docutils literal"><span class="pre">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</span></span></a></h3>
+<blockquote>
+<p>With <span class="docutils literal">&lt;polname&gt;</span> being for example <span class="docutils literal">P</span>, and <span class="docutils literal">&lt;sturmname&gt;</span> being
+for example <span class="docutils literal">S</span>, the macro starts by computing the derivative
+<span class="docutils literal">P'</span>, then computes the opposite of the remainder in the euclidean
+division of <span class="docutils literal">P</span> by <span class="docutils literal">P'</span>, then the opposite of the remainder in
+the euclidean division of <span class="docutils literal">P'</span> by the first obtained polynomial,
+etc... Up to signs following the <span class="docutils literal"><span class="pre">--++--++...</span></span> pattern, these are
+the same remainders as in the Euclide algorithm applied to the
+computation of the GCD of <span class="docutils literal">P</span> and <span class="docutils literal">P'</span>.</p>
+<p>The precise process differs from the above description: the
+algorithm first sets <span class="docutils literal">S_0_</span> to be the <em>primitive part</em> of <span class="docutils literal">P</span> and
+<span class="docutils literal">S_1_</span> to be the <em>primitive part</em> of <span class="docutils literal">P'</span> (see
+<a class="reference internal" href="#policontent-polname">\PolIContent{&lt;polname&gt;}</a>), then at each step the remainder is made
+primitive and stored for internal reference as <span class="docutils literal">S_k_</span>, so only
+integer-coefficients polynomials are manipulated.</p>
+<div class="admonition warning">
+<p class="admonition-title">Warning</p>
+<p>This exact procedure will perhaps in future be replaced by a
+<em>sub-resultant algorithm</em>, which may bring some speed gain in
+obtaining a pseudo-Sturm sequence, but some experimenting is
+needed, in the context of realistically realizable computations
+by the package; primitive polynomials although a bit costly
+have the smallest coefficients hence are the best for the kind of
+computations done for root localization, after having computed a
+Sturm sequence.</p>
+</div>
+<p>The last non-zero primitivized remainder <span class="docutils literal">S_N_</span> is, up to sign,
+the primitive part of the GCD of <span class="docutils literal">P</span> and <span class="docutils literal">P'</span>. Its roots (real
+and complex) are the multiple roots of the original <span class="docutils literal">P</span>. The
+original <span class="docutils literal">P</span> was &quot;square-free&quot; (i.e. did not have multiple real
+or complex roots) if and only if <span class="docutils literal">S_N_</span> is a constant, which is
+then <span class="docutils literal">+1</span> or <span class="docutils literal"><span class="pre">-1</span></span> (its value before primitivization is lost).</p>
+<p>The macro then divides each <span class="docutils literal">S_k_</span> by <span class="docutils literal">S_N_</span> and declares the
+quotients <span class="docutils literal">S_k</span> as user polynomials for future use. By Gauss
+theorem about the contents of integer-coefficients polynomials,
+these <span class="docutils literal">S_k</span> also are primitive integer-coefficients polynomials.</p>
+<p>This step will be referred to as <em>normalization</em>, and in this
+documentation the obtained polynomials are said to constitute the
+&quot;Sturm chain&quot; (or &quot;Sturm sequence&quot;), i.e. by convention the &quot;Sturm
+chain polynomials&quot; are square-free and primitive. The possibly
+non-square-free ones are referred to as <em>non-normalized</em>.</p>
+<p>As an exception to the rule, if the original <span class="docutils literal">P</span> was &quot;square-free&quot;
+(i.e. did not have multiple real or complex roots) then
+normalization is skipped (in that case <span class="docutils literal">S_N_</span> is either <span class="docutils literal">+1</span> or
+<span class="docutils literal"><span class="pre">-1</span></span>), so <span class="docutils literal">S_0_</span> is exactly the primitive part of starting
+polynomial <span class="docutils literal">P</span>, in the &quot;square-free&quot; case.</p>
+<p>The next logical step is to execute <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros{S}</a> or one of its variants. Be careful not to
+use the names <span class="docutils literal">sturmname_0</span>, <span class="docutils literal">sturmname_1</span>, etc... for defining
+other polynomials after having done
+<span class="docutils literal"><span class="pre">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</span></span> and before executing
+<span class="docutils literal"><span class="pre">\PolSturmIsolateZeros{&lt;sturmname&gt;}</span></span> or its variants else the
+latter will behave erroneously.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<ul class="simple">
-<li><p>Since <span class="docutils literal">0.5</span> all these polynomials are divided by their rational
-content, so they have integer coefficients with no common factor,
-and the last one if a constant is either <span class="docutils literal">1</span> or <span class="docutils literal"><span class="pre">-1</span></span>.</p></li>
-<li><p>After this normalization to primitive polynomials, they are
-stored internally as <span class="docutils literal">sturmname_k_</span>, <span class="docutils literal">k=0,1, ...</span>.</p></li>
-<li><p>These polynomials are used internally only. To keep them as
-genuine declared polynomials also after the macro call, use the
-starred variant <a class="reference internal" href="#id12">PolToSturm*</a>.</p></li>
-</ul>
+<p>The declaration of the <span class="docutils literal">S_k</span>'s will overwrite
+with no warning previously declared polynomials with identical
+names <span class="docutils literal">S_k</span>. This is original reason why the macro expects two
+names: <span class="docutils literal">&lt;polname&gt;</span> and <span class="docutils literal">&lt;sturmname&gt;</span>.</p>
+<p>It is allowed to use the polynomial name <span class="docutils literal">P</span> as Sturm chain
+name <span class="docutils literal">S</span>: <span class="docutils literal"><span class="pre">\PolToSturm{f}(f}</span></span>, but of course fusing the
+namespaces is slightly dangerous. And, also <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> creates variables sharing
+the <span class="docutils literal">&lt;sturmname&gt;</span> prefix, which must be taken into account to
+avoid name clashes.</p>
</div>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>It is perfectly allowed to use the polynomial name as Sturm chain name:
-<span class="docutils literal"><span class="pre">\PolToSturm{f}(f}</span></span>.</p>
-</div>
-<p>The macro then declares <span class="docutils literal">sturmname_0</span>, <span class="docutils literal">sturmname_1</span>, ..., which are
-the (non-declared) <span class="docutils literal">sturmname_k_</span> divided by the last one. Division is
-not done if this last one is the constant <span class="docutils literal">1</span> or <span class="docutils literal"><span class="pre">-1</span></span>, i.e. if the
-original polynomial was square-free. These polynomials are primitive
-polynomials too, i.e. with integer coefficients having no common factor.</p>
-<p>Thus <span class="docutils literal">sturmname_0</span> has exactly the same real and complex roots as
-polynomial <span class="docutils literal">polname</span>, but with each root now of multiplicity one:
-i.e. it is the &quot;square-free part&quot; of original polynomial <span class="docutils literal">polname</span>.</p>
-<p>Notice that <span class="docutils literal">sturmname_1</span> isn't necessarily the derivative of
-<span class="docutils literal">sturmname_0</span> due to the various normalizations.</p>
-<p>The polynomials <span class="docutils literal">sturmname_k</span> main utility is for the execution of
-<a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a>. Be careful not to use these
-names <span class="docutils literal">sturmname_0</span>, <span class="docutils literal">sturmname_1</span>, etc... for defining other
-polynomials after having done <span class="docutils literal"><span class="pre">\PolToSturm{polname}{sturmname}</span></span> and
-before executing <span class="docutils literal">\PolSturmIsolateZeros{sturmname}</span> else the
-latter will behave erroneously.</p>
-<p><a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a> gives the index of the last
-element of the Sturm chain.</p>
+<div class="admonition warning">
+<p class="admonition-title">Warning</p>
+<p>The reason why the <span class="docutils literal">S_k</span>'s are declared as polynomials is
+that the associated polynomial functions are needed to compute
+the sign changes in the Sturm sequence evaluated at a given
+location, as this is the basis mechanism of <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> (on the basis of the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm theorem</a>).</p>
+<p>It is possible that in future the package will only internally
+construct such polynomial functions and only the starred variant
+will make the normalized (i.e. square-free) Sturm sequence public.</p>
+</div>
+<p>The integer <span class="docutils literal">N</span> giving the length of the Sturm chain <span class="docutils literal">S_0</span>,
+<span class="docutils literal">S_1</span>, ..., <span class="docutils literal">S_N</span> is available as
+<a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{&lt;sturmname&gt;}</a>. If all roots of original <span class="docutils literal">P</span>
+are real, then <span class="docutils literal">N</span> is both the number of distinct real roots and
+the degree of <span class="docutils literal">S_0</span>. In the case of existence of complex roots,
+the number of distinct real roots is at most <span class="docutils literal">N</span> and <span class="docutils literal">N</span> is at
+most the degree of <span class="docutils literal">S_0</span>.</p>
</blockquote>
</div>
<div class="section" id="id13">
-<span id="id12"></span><h3><a class="toc-backref" href="#id113"><span class="docutils literal"><span class="pre">\PolToSturm*{polname}{sturmname}</span></span></a></h3>
+<span id="id12"></span><h3><a class="toc-backref" href="#id97"><span class="docutils literal"><span class="pre">\PolToSturm*{&lt;polname&gt;}{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>Does the same as <a class="reference internal" href="#poltosturm">un-starred version</a> and additionally it
-keeps for user usage the memory of the <em>un-normalized</em> Sturm chain
+keeps for user usage the memory of the <em>un-normalized</em> (but still
+made primitive) Sturm chain
polynomials <span class="docutils literal">sturmname_k_</span>, <span class="docutils literal">k=0,1, <span class="pre">...,</span> N</span>, with
-<span class="docutils literal">N</span> being <a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{sturmname}</a>.</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>This behaviour was modified at <span class="docutils literal">0.6</span>, anyhow the macro was
-broken at <span class="docutils literal">0.5</span>.</p>
-</div>
-<div class="admonition hint">
-<p class="admonition-title">Hint</p>
-<p>The square-free part of <span class="docutils literal">polname</span> is <span class="docutils literal">sturmname_0</span>, and their
-quotient is the polynomial with name
-<span class="docutils literal">sturname_\PolSturmChainLength{sturmname}_</span>. It thus easy to
-set-up a loop iteratively computing the latter until the last one
-is a constant, thus obtaining the decomposition of an <span class="docutils literal">f</span> as
-a product <span class="docutils literal">c f_1 f_2 f_3 ...</span> of a constant and square-free (primitive)
-polynomials, where each <span class="docutils literal">f_i</span> divides its predecessor.</p>
-</div>
-</blockquote>
-</div>
-<div class="section" id="polsettosturmchainsignchangesat-macro-sturmname-fraction">
-<span id="polsettosturmchainsignchangesat"></span><h3><a class="toc-backref" href="#id114"><span class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}</span></span></a></h3>
-<blockquote>
-<p>Sets macro <span class="docutils literal">\macro</span> to the number of sign changes in the Sturm
-chain with name prefix <span class="docutils literal">sturmname</span>, at location <span class="docutils literal">fraction</span>
-(which must be in format as acceptable by the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.)</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>The author was lazy and did not provide rather an expandable
-variant, where one would do <span class="docutils literal"><span class="pre">\edef\macro{\PolNbOf...}</span></span>.</p>
-<p>This will presumably get added in a future release.</p>
-<p>After some hesitation it was decided the macro would by default
-act globally. To make the scope of its macro definition local,
-use <span class="docutils literal">[\empty]</span> as extra optional argument.</p>
-</div>
-</blockquote>
-</div>
-<div class="section" id="polsettonbofzeroswithin-macro-sturmname-value-a-value-b">
-<span id="polsettonbofzeroswithin"></span><h3><a class="toc-backref" href="#id115"><span class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}</span></span></a></h3>
-<blockquote>
-<p>Applies the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a> to set <span class="docutils literal">\macro</span> to the exact number
-of <strong>distinct</strong> roots of <span class="docutils literal">sturmname_0</span> in the interval <span class="docutils literal">(value_a, value_b]</span> (the macro first re-orders the value for <span class="docutils literal">value_a &lt;= value_b</span> to hold).</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>The author was lazy and did not provide rather an expandable
-variant, where one would do <span class="docutils literal"><span class="pre">\edef\macro{\PolNbOf...}</span></span>.</p>
-<p>This will presumably get added in future.</p>
-<p>After some hesitation it was decided the macro would by default
-act globally. To make the scope of its macro definition local,
-use <span class="docutils literal">[\empty]</span> as extra optional argument.</p>
-</div>
-<p>See also the expandable
-<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a>, from
-which it is immediate (with <span class="docutils literal">\numexpr</span>) to create an expandable
-variant of this macro. However the difference is that this macro
-requires only <a class="reference internal" href="#poltosturm">\PolToSturm</a> to have been executed,
-whereas the expandable variant requires prior execution of
-<a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a>.</p>
-<p>See also the expandable
-<a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a>
-which requires prior execution of
-<a class="reference internal" href="#id14">\PolSturmIsolateZeros*</a>.</p>
+<span class="docutils literal">N</span> being <a class="reference internal" href="#polsturmchainlength-sturmname">\PolSturmChainLength{&lt;sturmname&gt;}</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatezeros-sturmname">
-<span id="polsturmisolatezeros"></span><h3><a class="toc-backref" href="#id116"><span class="docutils literal">\PolSturmIsolateZeros{sturmname}</span></a></h3>
+<span id="polsturmisolatezeros"></span><h3><a class="toc-backref" href="#id98"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
-<p>The macros locates, using <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm theorem</a>, as many disjoint
-intervals as there are (real) roots.</p>
+<p>The macro locates, using the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a>, as many disjoint
+intervals as there are distinct real roots.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>The Sturm chain must have been produced by an earlier
-<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</p>
-<p>Why does this macro ask for argument the name of Sturm chain,
-rather than the name of a polynomial? well this is mainly for
-legacy reason, and because it is accompanied by other macros for
-which it is simpler to assume the argument will be the name of an
-already computed Sturm chain.</p>
-<p>Notice that <span class="docutils literal"><span class="pre">\PolToSturm{f}{f}</span></span> is perfectly legal (the
-<span class="docutils literal">sturmname</span> can be same as the <span class="docutils literal">polname</span>): it defines
-polynomials <span class="docutils literal">f_0</span>, <span class="docutils literal">f_1</span>, ... having <span class="docutils literal">f</span> has name prefix.</p>
-<p>Such a prior call
-to <span class="docutils literal">\PolToSturm</span> must have been made at any rate for
-<span class="docutils literal">\PolSturmIsolateZeros</span> to be usable.</p>
+<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</a>.</p>
</div>
<p>After its execution they are two types of such intervals (stored in
memory and accessible via macros or <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables, see below):</p>
@@ -2568,56 +2536,60 @@ common in their respective decimal expansions.</p>
<p>If some two consecutive intervals share an end-point, no
information is yet gained about the separation between the two
roots which could at this stage be arbitrarily small.</p>
-<p>See <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{sturmname}{index}</a> which addresses
+<p>See <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{&lt;sturmname&gt;}{&lt;index&gt;}</a> which addresses
this issue.</p>
</div>
+<p>Let us suppose <span class="docutils literal">&lt;sturmname&gt;</span> is <span class="docutils literal">S</span>.</p>
<p>The interval boundaries (and exactly found roots) are made available
-for future computations in <span class="docutils literal">\xintexpr</span>-essions or polynomial
-definitions as variables <span class="docutils literal">&lt;sturmname&gt;L_1</span>,
-<span class="docutils literal">&lt;sturmname&gt;L_2</span>, etc..., for the left end-points and
-<span class="docutils literal">&lt;sturmname&gt;R_1</span>, <span class="docutils literal">&lt;sturmname&gt;R_2</span>, ..., for the right
-end-points.</p>
-<p>Thus for example, if <span class="docutils literal">sturmname</span> is <span class="docutils literal">f</span>, one can use the
-<a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables <span class="docutils literal">fL_1</span>, <span class="docutils literal">fL_2</span>, ... to refer in expressions
-to the left end-points (or to the exact root, if left and right end
-points coincide). Additionally, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variable <span class="docutils literal">fZ_1_isknown</span>
-will have value <span class="docutils literal">1</span> if the root in the first interval is known,
-and <span class="docutils literal">0</span> otherwise. And similarly for the other intervals.</p>
-<p>Also, macros <a class="reference internal" href="#polsturmisolatedzeroleft-sturmname-index">\PolSturmIsolatedZeroLeft{sturmname}{index}</a> and
-<a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index">\PolSturmIsolatedZeroRight{sturmname}{index}</a> are provided which
+for future computations in <span class="docutils literal">\xintexpr/xinteval</span> or <span class="docutils literal">\poldef</span> as
+variables <span class="docutils literal">SL_1</span>, <span class="docutils literal">SL_2</span>, etc..., for the left end-points and
+<span class="docutils literal">SR_1</span>, <span class="docutils literal">SR_2</span>, ..., for the right end-points.</p>
+<p>Additionally, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variable <span class="docutils literal">SZ_1_isknown</span> will have value
+<span class="docutils literal">1</span> if the root in the first interval is known, and <span class="docutils literal">0</span>
+otherwise. And similarly for the other intervals.</p>
+<div class="admonition important">
+<p class="admonition-title">Important</p>
+<p>The variable declarations are done with no check of existence of
+previously existing variables with identical names.</p>
+</div>
+<p>Also, macros <a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft{&lt;sturmname&gt;}{&lt;index&gt;}</a> and
+<a class="reference internal" href="#polsturmisolatedzeroright-sturmname-index">\PolSturmIsolatedZeroRight{&lt;sturmname&gt;}{&lt;index&gt;}</a> are provided which
expand to these same values, written in decimal notation (i.e.
pre-processed by <a class="reference internal" href="#poldectostring">\PolDecToString</a>.) And there
-is also <a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-a-b">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</a>.</p>
+is also <a class="reference internal" href="#polsturmifzeroexactlyknown-sturmname-index-t-f">\PolSturmIfZeroExactlyKnown{&lt;sturmname&gt;}{&lt;index&gt;}{T}{F}</a>.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Trailing zeroes in the stored decimal numbers accessible via the
macros are significant: they are also present in the decimal
-expansion of the exact root.</p>
-</div>
-<p>These variables and macros are automatically updated when one next
-uses macros such as <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{sturmname}{index}</a>.</p>
-<p>The start of decimal expansion of a positive <span class="docutils literal">k</span>-th root is given
-by <a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft{sturmname}{k}</a>, and for a negative root it is given
-by <a class="reference internal" href="#polsturmisolatedzeroright">PolSturmIsolatedZeroRight{sturmname}{k}</a>. These two decimal
-numbers are either both zero or both of the same sign.</p>
+expansion of the exact root, so as to be able for example to
+print out bounds of real roots with as many digits as is
+significant, even if the digits are zeros.</p>
+</div>
+<p>The start of the decimal expansion of the <span class="docutils literal">&lt;index&gt;</span>-th root is given by
+<a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft{&lt;sturmname&gt;}{&lt;index&gt;}</a> if the root is positive, and by
+<a class="reference internal" href="#polsturmisolatedzeroright">PolSturmIsolatedZeroRight{&lt;sturmname&gt;}{&lt;index&gt;}</a> if the root is neagtive. These two
+decimal numbers are either both zero or both of the same sign.</p>
<p>The number of distinct roots is obtainable expandably as
-<a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname">\PolSturmNbOfIsolatedZeros{sturmname}</a>.</p>
+<a class="reference internal" href="#polsturmnbofisolatedzeros-sturmname">\PolSturmNbOfIsolatedZeros{&lt;sturmname&gt;}</a>.</p>
<p>Furthermore
-<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a> and
-<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a>.
+<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</a> and
+<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-num-expr">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num. expr.&gt;}</a>.
will expandably compute respectively the number of real roots at
most equal to <span class="docutils literal">value</span> or <span class="docutils literal">expression</span>, and the same but with
multiplicities.</p>
+<p>These variables and macros are automatically updated in case of
+subsequent usage of <a class="reference internal" href="#polrefineinterval-sturmname-index">\PolRefineInterval*{&lt;sturmname&gt;}{&lt;index&gt;}</a> or
+other localization improving macros.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The current polexpr implementation defines the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables
-and <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> arrays described above with <strong>global scpe</strong>. On the
-other hand the Sturm sequence polynomials do obey the current scope.</p>
+and <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> arrays as described above with global scope. On the
+other hand the Sturm sequence polynomials obey the current scope.</p>
+<p>This is perhaps a bit inconsistent and may change in future.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>As all computations are done <em>exactly</em> there can be no errors...
-apart those due to bad coding by author. The results are exact
+<p>The results are exact
bounds for the mathematically exact real roots.</p>
<p>Future releases will perhaps also provide macros based on Newton
or Regula Falsi methods. Exact computations with such methods
@@ -2629,35 +2601,41 @@ are studied in numerical mathematics.</p>
</blockquote>
</div>
<div class="section" id="id15">
-<span id="id14"></span><h3><a class="toc-backref" href="#id117"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{sturmname}</span></span></a></h3>
+<span id="id14"></span><h3><a class="toc-backref" href="#id99"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
-<p>The macro does the same as <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> and
+<p>The macro does the same as <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> and
then in addition it does the extra work to determine all
-multiplicities (of the real roots):
-after executing this macro,
-<a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a> will expand
+multiplicities of the real roots.</p>
+<p>After execution,
+<a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{&lt;sturmname&gt;}{&lt;index&gt;}</a> expands
to the multiplicity of the root located in the <span class="docutils literal">index</span>-th
interval (intervals are enumerated from left to right, with index
starting at <span class="docutils literal">1</span>).</p>
-<p>Furthermore, if for example the <span class="docutils literal">sturmname</span> is <span class="docutils literal">f</span>, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>
-variables <span class="docutils literal">fM_1</span>, <span class="docutils literal">fM_2</span>... hold the multiplicities thus
+<p>Furthermore, if for example the <span class="docutils literal">&lt;sturmname&gt;</span> is <span class="docutils literal">S</span>, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>
+variables <span class="docutils literal">SM_1</span>, <span class="docutils literal">SM_2</span>... hold the multiplicities thus
computed.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>It is <strong>not</strong> necessary to have executed the <a class="reference internal" href="#id12">PolToSturm*</a> starred
-variant, as the non-starred variant keeps internally the memory of the
-original GCD (and even of the full non-normalized original Sturm
-chain), even though it does not make the declarations as <em>user-level</em>
-genuine polynomials.</p>
+<p>Somewhat counter-intuitively, it is not necessary to have
+executed the <a class="reference internal" href="#id12">\PolToSturm*</a> starred variant: during its
+execution, <a class="reference internal" href="#poltosturm">\PolToSturm</a>, even though it does not declare the
+non-square-free Sturm chain polynomials as user-level genuine
+polynomials, stores their data in private macros.</p>
</div>
<p>See <a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple
roots</a> for an example.</p>
</blockquote>
+<div class="section" id="polsturmisolatezerosandgetmultiplicities-sturmname">
+<span id="polsturmisolatezerosandgetmultiplicities"></span><h4><a class="toc-backref" href="#id100"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{&lt;sturmname&gt;}</span></span></a></h4>
+<blockquote>
+<p>This is another name for <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</a>.</p>
+</blockquote>
+</div>
</div>
<div class="section" id="id17">
-<span id="id16"></span><h3><a class="toc-backref" href="#id118"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{sturmname}</span></span></a></h3>
+<span id="id16"></span><h3><a class="toc-backref" href="#id101"><span class="docutils literal"><span class="pre">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
-<p>The macro does the same as <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{sturmname}</a> and
+<p>The macro does the same as <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</a> and
in addition it does the extra work to determine all the <em>rational</em>
roots.</p>
<div class="admonition note">
@@ -2670,7 +2648,7 @@ to match the (square-free) <span class="docutils literal">sturmname_0</span> fro
roots have been removed (see <a class="reference internal" href="#polexprsetup">\polexprsetup</a> for customizing this
name). The number of distinct rational roots is thus the difference
between the degrees of these two polynomials (see also
-<a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{sturmname}</a>).</p>
+<a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{&lt;sturmname&gt;}</a>).</p>
<p>And <span class="docutils literal">sturmname_norr</span> is <span class="docutils literal">sturmname_0_</span> from which all rational
roots have been removed (see <a class="reference internal" href="#polexprsetup">\polexprsetup</a>), i.e. it contains
the irrational roots of the original polynomial, with the same
@@ -2678,23 +2656,17 @@ multiplicities.</p>
<p>See <a class="reference internal" href="#a-degree-five-polynomial-with-three-rational-roots">A degree five polynomial with three rational
roots</a> for an example.</p>
</blockquote>
-</div>
-<div class="section" id="polsturmisolatezerosandgetmultiplicities-sturmname">
-<span id="polsturmisolatezerosandgetmultiplicities"></span><h3><a class="toc-backref" href="#id119"><span class="docutils literal">\PolSturmIsolateZerosAndGetMultiplicities{sturmname}</span></a></h3>
-<blockquote>
-<p>This is another name for <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{sturmname}</a>.</p>
-</blockquote>
-</div>
<div class="section" id="polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname">
-<span id="polsturmisolatezerosgetmultiplicitiesandrationalroots"></span><h3><a class="toc-backref" href="#id120"><span class="docutils literal">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</span></a></h3>
+<span id="polsturmisolatezerosgetmultiplicitiesandrationalroots"></span><h4><a class="toc-backref" href="#id102"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{&lt;sturmname&gt;}</span></span></a></h4>
<blockquote>
-<p>This is another name for <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a>.</p>
+<p>This is another name for <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a>.</p>
</blockquote>
</div>
+</div>
<div class="section" id="polsturmisolatezerosandfindrationalroots-sturmname">
-<h3><a class="toc-backref" href="#id121"><span class="docutils literal">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</span></a></h3>
+<h3><a class="toc-backref" href="#id103"><span class="docutils literal"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
-<p>This works exactly like <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a>
+<p>This works exactly like <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a>
(inclusive of declaring the polynomials <span class="docutils literal">sturmname_sqf_norr</span> and
<span class="docutils literal">sturmname_norr</span> with no rational roots) except that it does <em>not</em>
compute the multiplicities of the <em>non-rational</em> roots.</p>
@@ -2708,11 +2680,11 @@ their multiplicities at the same time.</p>
<p>This macro does <em>not</em> define <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> variables
<span class="docutils literal">sturmnameM_1</span>, <span class="docutils literal">sturmnameM_2</span>, ... holding the
multiplicities and it leaves the multiplicity array (whose accessor
-is <a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a>) into
+is <a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{&lt;sturmname&gt;}{&lt;index&gt;}</a>) into
a broken state, as all non-rational roots will supposedly have
multiplicity one. This means that the output of
-<a class="reference internal" href="#id21">\PolPrintIntervals*</a> for example will be
-erroneous for the intervals with irrational roots.</p>
+<a class="reference internal" href="#id21">\PolPrintIntervals*</a> will be
+erroneous regarding the multiplicities of irrational roots.</p>
<p>I decided to document it because finding multiplicities of the
non rational roots is somewhat costly, and one may be interested
only into finding the rational roots (of course random
@@ -2722,44 +2694,43 @@ rational root anyhow).</p>
</blockquote>
</div>
<div class="section" id="polrefineinterval-sturmname-index">
-<span id="polrefineinterval"></span><h3><a class="toc-backref" href="#id122"><span class="docutils literal"><span class="pre">\PolRefineInterval*{sturmname}{index}</span></span></a></h3>
+<span id="polrefineinterval"></span><h3><a class="toc-backref" href="#id104"><span class="docutils literal"><span class="pre">\PolRefineInterval*{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>The <span class="docutils literal">index</span>-th interval (starting indexing at one) is further
subdivided as many times as is necessary in order for the newer
interval to have both its end-points distinct from the end-points of
-the original interval. This means that the <span class="docutils literal">k</span>th root is then
+the original interval. As a consequence, the <span class="docutils literal">k</span>th root is then
strictly separated from the other roots.</p>
</blockquote>
</div>
<div class="section" id="polrefineinterval-n-sturmname-index">
-<span id="polrefineinterval-n"></span><h3><a class="toc-backref" href="#id123"><span class="docutils literal"><span class="pre">\PolRefineInterval[N]{sturmname}{index}</span></span></a></h3>
+<span id="polrefineinterval-n"></span><h3><a class="toc-backref" href="#id105"><span class="docutils literal"><span class="pre">\PolRefineInterval[N]{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>The <span class="docutils literal">index</span>-th interval (starting count at one) is further
subdivided once, reducing its length by a factor of 10. This is done
<span class="docutils literal">N</span> times if the optional argument <span class="docutils literal">[N]</span> is present.</p>
</blockquote>
</div>
-<div class="section" id="polensureintervallength-sturmname-index-e">
-<span id="polensureintervallength"></span><h3><a class="toc-backref" href="#id124"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLength{sturmname}{index}{E}</span></span></a></h3>
+<div class="section" id="polensureintervallength-sturmname-index-exponent">
+<span id="polensureintervallength"></span><h3><a class="toc-backref" href="#id106"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLength{&lt;sturmname&gt;}{&lt;index&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
<p>The <span class="docutils literal">index</span>-th interval is subdivided until its length becomes at
most <span class="docutils literal">10^E</span>. This means (for <span class="docutils literal">E&lt;0</span>) that the first <span class="docutils literal"><span class="pre">-E</span></span> digits
after decimal mark of the <span class="docutils literal">k</span>th root will then be known exactly.</p>
</blockquote>
</div>
-<div class="section" id="polensureintervallengths-sturmname-e">
-<span id="polensureintervallengths"></span><h3><a class="toc-backref" href="#id125"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{sturmname}{E}</span></span></a></h3>
+<div class="section" id="polensureintervallengths-sturmname-exponent">
+<span id="polensureintervallengths"></span><h3><a class="toc-backref" href="#id107"><span class="docutils literal"><span class="pre">\PolEnsureIntervalLengths{&lt;sturmname&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
<p>The intervals as obtained from <span class="docutils literal">\PolSturmIsolateZeros</span> are (if
necessary) subdivided further by (base 10) dichotomy in order for
-each of them to have length at most <span class="docutils literal">10^E</span> (length will be shorter
-than <span class="docutils literal">10^E</span> in output only if it did not change or became zero.)</p>
+each of them to have length at most <span class="docutils literal">10^E</span>.</p>
<p>This means that decimal expansions of all roots will be known with
<span class="docutils literal"><span class="pre">-E</span></span> digits (for <span class="docutils literal">E&lt;0</span>) after decimal mark.</p>
</blockquote>
</div>
<div class="section" id="polprintintervals-varname-sturmname">
-<span id="polprintintervals"></span><h3><a class="toc-backref" href="#id126"><span class="docutils literal"><span class="pre">\PolPrintIntervals[varname]{sturmname}</span></span></a></h3>
+<span id="polprintintervals"></span><h3><a class="toc-backref" href="#id108"><span class="docutils literal"><span class="pre">\PolPrintIntervals[&lt;varname&gt;]{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>This is a convenience macro which prints the bounds for the roots
<span class="docutils literal">Z_1</span>, <span class="docutils literal">Z_2</span>, ... (the optional argument <span class="docutils literal">varname</span> allows to
@@ -2780,7 +2751,7 @@ primitives.</p>
<p>See next macros which govern its output.</p>
</blockquote>
<div class="section" id="polprintintervalsnorealroots">
-<h4><a class="toc-backref" href="#id127"><span class="docutils literal">\PolPrintIntervalsNoRealRoots</span></a></h4>
+<h4><a class="toc-backref" href="#id109"><span class="docutils literal">\PolPrintIntervalsNoRealRoots</span></a></h4>
<blockquote>
<p>Executed in place of an <span class="docutils literal">array</span> environment, when there are no
real roots. Default definition:</p>
@@ -2788,21 +2759,21 @@ real roots. Default definition:</p>
</blockquote>
</div>
<div class="section" id="polprintintervalsbeginenv">
-<h4><a class="toc-backref" href="#id128"><span class="docutils literal">\PolPrintIntervalsBeginEnv</span></a></h4>
+<h4><a class="toc-backref" href="#id110"><span class="docutils literal">\PolPrintIntervalsBeginEnv</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsBeginEnv{\[\begin{array}{rcccl}}</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsendenv">
-<h4><a class="toc-backref" href="#id129"><span class="docutils literal">\PolPrintIntervalsEndEnv</span></a></h4>
+<h4><a class="toc-backref" href="#id111"><span class="docutils literal">\PolPrintIntervalsEndEnv</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsEndEnv{\end{array}\]}</pre>
</blockquote>
</div>
<div class="section" id="polprintintervalsknownroot">
-<h4><a class="toc-backref" href="#id130"><span class="docutils literal">\PolPrintIntervalsKnownRoot</span></a></h4>
+<h4><a class="toc-backref" href="#id112"><span class="docutils literal">\PolPrintIntervalsKnownRoot</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsKnownRoot{%
@@ -2812,7 +2783,7 @@ real roots. Default definition:</p>
</blockquote>
</div>
<div class="section" id="polprintintervalsunknownroot">
-<h4><a class="toc-backref" href="#id131"><span class="docutils literal">\PolPrintIntervalsUnknownRoot</span></a></h4>
+<h4><a class="toc-backref" href="#id113"><span class="docutils literal">\PolPrintIntervalsUnknownRoot</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsUnknownRoot{%
@@ -2823,21 +2794,21 @@ real roots. Default definition:</p>
</blockquote>
</div>
<div class="section" id="id18">
-<span id="polprintintervalsprintexactzero"></span><h4><a class="toc-backref" href="#id132"><span class="docutils literal">\PolPrintIntervalsPrintExactZero</span></a></h4>
+<span id="polprintintervalsprintexactzero"></span><h4><a class="toc-backref" href="#id114"><span class="docutils literal">\PolPrintIntervalsPrintExactZero</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsPrintExactZero{\PolPrintIntervalsTheLeftEndPoint}</pre>
</blockquote>
</div>
<div class="section" id="id19">
-<span id="polprintintervalsprintleftendpoint"></span><h4><a class="toc-backref" href="#id133"><span class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</span></a></h4>
+<span id="polprintintervalsprintleftendpoint"></span><h4><a class="toc-backref" href="#id115"><span class="docutils literal">\PolPrintIntervalsPrintLeftEndPoint</span></a></h4>
<blockquote>
<p>Default definition:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsPrintLeftEndPoint{\PolPrintIntervalsTheLeftEndPoint}</pre>
</blockquote>
</div>
<div class="section" id="id20">
-<span id="polprintintervalsprintrightendpoint"></span><h4><a class="toc-backref" href="#id134"><span class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</span></a></h4>
+<span id="polprintintervalsprintrightendpoint"></span><h4><a class="toc-backref" href="#id116"><span class="docutils literal">\PolPrintIntervalsPrintRightEndPoint</span></a></h4>
<blockquote>
<p>Default definition is:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsPrintRightEndPoint{\PolPrintIntervalsTheRightEndPoint}</pre>
@@ -2845,7 +2816,7 @@ real roots. Default definition:</p>
</div>
</div>
<div class="section" id="id22">
-<span id="id21"></span><h3><a class="toc-backref" href="#id135"><span class="docutils literal"><span class="pre">\PolPrintIntervals*[varname]{sturmname}</span></span></a></h3>
+<span id="id21"></span><h3><a class="toc-backref" href="#id117"><span class="docutils literal"><span class="pre">\PolPrintIntervals*[&lt;varname&gt;]{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>This starred variant produces an alternative output (which
displays the root multiplicity), and is provided as an
@@ -2862,26 +2833,123 @@ definition:</p>
<p>Multiplicities are printed using this auxiliary macro:</p>
</blockquote>
<div class="section" id="polprintintervalsprintmultiplicity">
-<h4><a class="toc-backref" href="#id136"><span class="docutils literal">\PolPrintIntervalsPrintMultiplicity</span></a></h4>
+<h4><a class="toc-backref" href="#id118"><span class="docutils literal">\PolPrintIntervalsPrintMultiplicity</span></a></h4>
<blockquote>
<p>whose default definition is:</p>
<pre class="literal-block">\newcommand\PolPrintIntervalsPrintMultiplicity{(\mbox{mult. }\PolPrintIntervalsTheMultiplicity)}</pre>
</blockquote>
</div>
</div>
+<div class="section" id="polsettosturmchainsignchangesat-foo-sturmname-value">
+<span id="polsettosturmchainsignchangesat"></span><h3><a class="toc-backref" href="#id119"><span class="docutils literal"><span class="pre">\PolSetToSturmChainSignChangesAt{\foo}{&lt;sturmname&gt;}{&lt;value&gt;}</span></span></a></h3>
+<blockquote>
+<p>Sets macro <span class="docutils literal">\foo</span> to store the number of sign changes in the
+already computed normalized Sturm chain with name prefix
+<span class="docutils literal">&lt;sturmname&gt;</span>, at location <span class="docutils literal">&lt;value&gt;</span> (which must be in format as
+acceptable by the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.)</p>
+<p>The definition is made with global scope. For local scope, use
+<span class="docutils literal">[\empty]</span> as extra optional argument.</p>
+<p>One can use this immediately after creation of the Sturm chain.</p>
+</blockquote>
+</div>
+<div class="section" id="polsettonbofzeroswithin-foo-sturmname-value-left-value-right">
+<span id="polsettonbofzeroswithin"></span><h3><a class="toc-backref" href="#id120"><span class="docutils literal"><span class="pre">\PolSetToNbOfZerosWithin{\foo}{&lt;sturmname&gt;}{&lt;value_left&gt;}{&lt;value_right&gt;}</span></span></a></h3>
+<blockquote>
+<p>Sets, assuming the normalized Sturm chain has been already computed,
+macro <span class="docutils literal">\foo</span> to store the number of roots of <span class="docutils literal">sturmname_0</span> in
+the interval <span class="docutils literal">(value_left, value_right]</span>. The macro first
+re-orders end-points if necessary for <span class="docutils literal">value_left &lt;= value_right</span>
+to hold.</p>
+<p>In accordance to <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a> this is computed as the difference
+between the number of sign changes of the Sturm chain at <span class="docutils literal">value_right</span>
+and the one at <span class="docutils literal">value_left</span>.</p>
+<p>The definition is made with global scope. For local scope, use
+<span class="docutils literal">[\empty]</span> as extra optional argument.</p>
+<p>One can use this immediately after creation of a Sturm chain.</p>
+<p>See also the expandable
+<a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</a>,
+which however requires prior execution of <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a>.</p>
+<p>See also the expandable
+<a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</a>
+which requires prior execution of
+<a class="reference internal" href="#id14">\PolSturmIsolateZeros*</a>.</p>
+</blockquote>
+</div>
+</div>
+<div class="section" id="pollet-polname-2-polname-1">
+<span id="pollet"></span><h2><a class="toc-backref" href="#id121"><span class="docutils literal"><span class="pre">\PolLet{&lt;polname_2&gt;}={&lt;polname_1&gt;}</span></span></a></h2>
+<blockquote>
+<p>Makes a copy of the already defined polynomial <span class="docutils literal">polname_1</span> to a
+new one <span class="docutils literal">polname_2</span>. This has the same effect as
+<span class="docutils literal"><span class="pre">\PolDef{&lt;polname_2&gt;}{&lt;polname_1&gt;(x)}</span></span> or (better)
+<span class="docutils literal"><span class="pre">\PolDef{&lt;polname_2&gt;}{&lt;polname_1&gt;}</span></span> but with less overhead. The
+<span class="docutils literal">=</span> is optional.</p>
+</blockquote>
+</div>
+<div class="section" id="polgloballet-polname-2-polname-1">
+<span id="polgloballet"></span><h2><a class="toc-backref" href="#id122"><span class="docutils literal"><span class="pre">\PolGlobalLet{&lt;polname_2&gt;}={&lt;polname_1&gt;}</span></span></a></h2>
+<blockquote>
+<p>Acts globally.</p>
+</blockquote>
+</div>
+<div class="section" id="polassign-polname-toarray-macro">
+<span id="polassign"></span><h2><a class="toc-backref" href="#id123"><span class="docutils literal"><span class="pre">\PolAssign{&lt;polname&gt;}\toarray\macro</span></span></a></h2>
+<blockquote>
+<p>Defines a one-argument expandable macro <span class="docutils literal"><span class="pre">\macro{#1}</span></span> which expands
+to the (raw) #1th polynomial coefficient.</p>
+<ul class="simple">
+<li><p>Attention, coefficients here are indexed starting at 1. This is
+an unfortunate legacy situation related to the original indexing
+convention in <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> arrays.</p></li>
+<li><p>With #1=-1, -2, ..., <span class="docutils literal"><span class="pre">\macro{#1}</span></span> returns leading coefficients.</p></li>
+<li><p>With #1=0, returns the number of coefficients, i.e. <span class="docutils literal">1 + deg f</span>
+for non-zero polynomials.</p></li>
+<li><p>Out-of-range #1's return <span class="docutils literal">0/1[0]</span>.</p></li>
+</ul>
+<p>See also <a class="reference internal" href="#polnthcoeff-polname-index">\PolNthCoeff{&lt;polname&gt;}{&lt;index&gt;}</a>.</p>
+</blockquote>
+</div>
+<div class="section" id="polget-polname-fromarray-macro">
+<span id="polget"></span><h2><a class="toc-backref" href="#id124"><span class="docutils literal"><span class="pre">\PolGet{&lt;polname&gt;}\fromarray\macro</span></span></a></h2>
+<blockquote>
+<p>Does the converse operation to
+<span class="docutils literal"><span class="pre">\PolAssign{&lt;polname&gt;}\toarray\macro</span></span>. Each individual
+<span class="docutils literal"><span class="pre">\macro{&lt;value&gt;}</span></span> gets expanded in an <span class="docutils literal">\edef</span> and then normalized
+via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <span class="docutils literal">\xintRaw</span>.</p>
+<p>The leading zeros are removed from the polynomial.</p>
+<p>(contrived) Example:</p>
+<pre class="literal-block">\xintAssignArray{1}{-2}{5}{-3}\to\foo
+\PolGet{f}\fromarray\foo</pre>
+<p>This will define <span class="docutils literal">f</span> as would have <span class="docutils literal">\poldef <span class="pre">f(x):=1-2x+5x^2-3x^3;</span></span>.</p>
+</blockquote>
+</div>
+<div class="section" id="polfromcsv-polname-csv">
+<span id="polfromcsv"></span><h2><a class="toc-backref" href="#id125"><span class="docutils literal"><span class="pre">\PolFromCSV{&lt;polname&gt;}{&lt;csv&gt;}</span></span></a></h2>
+<blockquote>
+<p>Defines a polynomial directly from the comma separated list of values
+(or a macro expanding to such a list) of its coefficients, the <em>first
+item</em> gives the constant term, the <em>last item</em> gives the leading
+coefficient, except if zero, then it is dropped (iteratively). List
+items are each expanded in an <span class="docutils literal">\edef</span> and then put into normalized
+form via <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>'s macro <span class="docutils literal">\xintRaw</span>.</p>
+<p>As leading zero coefficients are removed:</p>
+<pre class="literal-block">\PolFromCSV{f}{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}</pre>
+<p>defines the zero polynomial, which holds only one coefficient.</p>
+<p>See also expandable macro <a class="reference internal" href="#poltocsv-polname">\PolToCSV{&lt;polname&gt;}</a>.</p>
+</blockquote>
</div>
<div class="section" id="polmapcoeffs-macro-polname">
-<span id="polmapcoeffs"></span><h2><a class="toc-backref" href="#id137"><span class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{polname}</span></span></a></h2>
+<span id="polmapcoeffs"></span><h2><a class="toc-backref" href="#id126"><span class="docutils literal"><span class="pre">\PolMapCoeffs{\macro}{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
<p>It modifies ('in-place': original coefficients get lost) each
coefficient of the defined polynomial via the <em>expandable</em> macro
<span class="docutils literal">\macro</span>. The degree is adjusted as necessary if some leading
-coefficients vanish after the operation. In replacement text of
-<span class="docutils literal">\macro</span>, <span class="docutils literal">\index</span> expands to the coefficient index (which is
-defined to be zero for the constant term).</p>
-<p>Notice that <span class="docutils literal">\macro</span> will have to handle inputs of the shape
-<span class="docutils literal">A/B[N]</span> (<a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> internal notation). This means that it probably
-will have to be expressed in terms of macros from <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> package.</p>
+coefficients vanish after the operation.</p>
+<p>In the replacement text of <span class="docutils literal">\macro</span>, <span class="docutils literal">\index</span> expands to the
+coefficient index (starting at zero for the constant term).</p>
+<p>Notice that <span class="docutils literal">\macro</span> will have to handle inputs in the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>
+internal format. This means that it probably will have to be
+expressed in terms of macros from the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> package.</p>
<p>Example:</p>
<pre class="literal-block">\def\foo#1{\xintMul{#1}{\the\numexpr\index*\index\relax}}</pre>
<p>(or with <span class="docutils literal"><span class="pre">\xintSqr{\index}</span></span>) to replace <span class="docutils literal">n</span>-th coefficient
@@ -2889,175 +2957,132 @@ will have to be expressed in terms of macros from <a class="reference external"
</blockquote>
</div>
<div class="section" id="polreducecoeffs-polname">
-<span id="polreducecoeffs"></span><h2><a class="toc-backref" href="#id138"><span class="docutils literal">\PolReduceCoeffs{polname}</span></a></h2>
+<span id="polreducecoeffs"></span><h2><a class="toc-backref" href="#id127"><span class="docutils literal"><span class="pre">\PolReduceCoeffs{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
-<p>About the same as <span class="docutils literal"><span class="pre">\PolMapCoeffs{\xintIrr}{polname}</span></span> (but
-maintaining a <span class="docutils literal">[0]</span> postfix for speedier <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> parsing when
-polynomial function is used for computations.) This is a
-one-argument macro, working 'in-place'.</p>
+<p>Reduces the internal representations of the coefficients to
+their lowest terms.</p>
</blockquote>
</div>
<div class="section" id="id24">
-<span id="id23"></span><h2><a class="toc-backref" href="#id139"><span class="docutils literal"><span class="pre">\PolReduceCoeffs*{polname}</span></span></a></h2>
-<blockquote>
-<p>This starred variant leaves un-touched the decimal exponent in the
-internal representation of the fractional coefficients, i.e. if a
-coefficient is internally <span class="docutils literal">A/B[N]</span>, then <span class="docutils literal">A/B</span> is reduced to
-smallest terms, but the <span class="docutils literal">10^N</span> part is kept as is. Note: if the
-polynomial is freshly defined directly via <a class="reference internal" href="#polfromcsv">\PolFromCSV</a> its coefficients might still be internally in some
-format like <span class="docutils literal">1.5e7</span>; the macro will anyhow always first do the
-needed conversion to strict format <span class="docutils literal">A/B[N]</span>.</p>
+<span id="id23"></span><h2><a class="toc-backref" href="#id128"><span class="docutils literal"><span class="pre">\PolReduceCoeffs*{&lt;polname&gt;}</span></span></a></h2>
+<blockquote>
+<p>Reduces the internal representations of the coefficients to their
+lowest terms, but ignoring a possible separated &quot;power of ten part&quot;.</p>
+<p>For example, <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> stores an <span class="docutils literal">30e2/50</span> input as <span class="docutils literal">30/50</span> with
+a separate <span class="docutils literal">10^2</span> part. This will thus get replaced by <span class="docutils literal">3e^2/5</span>
+(or rather whatever <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> uses for internal representation), and
+not by <span class="docutils literal">60</span> as would result from complete reduction.</p>
<p>Evaluations with polynomials treated by this can be much faster than
with those handled by the non-starred variant
-<a class="reference internal" href="#polreducecoeffs-polname">\PolReduceCoeffs{polname}</a>: as the numerators and denominators
-remain smaller, this proves very beneficial in favorable cases
-(especially when the coefficients are decimal numbers) to the
-expansion speed of the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros used internally by
-<a class="reference internal" href="#polevalat">\PolEval</a>.</p>
+<a class="reference internal" href="#polreducecoeffs-polname">\PolReduceCoeffs{&lt;polname&gt;}</a>: as the numerators and denominators
+remain generally smaller.</p>
</blockquote>
</div>
<div class="section" id="polmakemonic-polname">
-<span id="polmakemonic"></span><h2><a class="toc-backref" href="#id140"><span class="docutils literal">\PolMakeMonic{polname}</span></a></h2>
+<span id="polmakemonic"></span><h2><a class="toc-backref" href="#id129"><span class="docutils literal"><span class="pre">\PolMakeMonic{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
<p>Divides by the leading coefficient. It is recommended to execute
-<a class="reference internal" href="#id24">\PolReduceCoeffs*{polname}</a> immediately afterwards. This is not
-done automatically, due to the case the original polynomial had integer
-coefficients and we want to keep the leading one as common
-denominator.</p>
+<a class="reference internal" href="#id24">\PolReduceCoeffs*{&lt;polname&gt;}</a> immediately afterwards. This is not
+done automatically, in case the original polynomial had integer
+coefficients and the user wants to keep the leading one as common
+denominator for typesetting purposes.</p>
</blockquote>
</div>
<div class="section" id="polmakeprimitive-polname">
-<span id="polmakeprimitive"></span><h2><a class="toc-backref" href="#id141"><span class="docutils literal">\PolMakePrimitive{polname}</span></a></h2>
+<span id="polmakeprimitive"></span><h2><a class="toc-backref" href="#id130"><span class="docutils literal"><span class="pre">\PolMakePrimitive{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
-<p>Divides by the integer content see (<a class="reference internal" href="#policontent">\PolIContent</a>). This thus produces a polynomial with integer
+<p>Divides by the integer content see (<a class="reference internal" href="#policontent">\PolIContent</a>).
+This thus produces a polynomial with integer
coefficients having no common factor. The sign of the leading
coefficient is not modified.</p>
</blockquote>
</div>
-</div>
-<div class="section" id="expandable-macros">
-<h1><a class="toc-backref" href="#id142">Expandable macros</a></h1>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p>At <span class="docutils literal">0.8</span> <span class="docutils literal">polexpr</span> is usable with Plain TeX and not only with
-LaTeX. Some examples given in this section may be using LaTeX syntax
-such as <span class="docutils literal">\renewcommand</span>. Convert to TeX primitives as appropriate
-if testing with a non LaTeX macro format.</p>
-</div>
-<p>All these macros expand completely in two steps except <span class="docutils literal">\PolToExpr</span>
-and <span class="docutils literal">\PolToFloatExpr</span> (and their auxiliaries) which need a
-<span class="docutils literal">\write</span>, <span class="docutils literal">\edef</span> or a <span class="docutils literal"><span class="pre">\csname...\endcsname</span></span> context.</p>
-<div class="section" id="poleval-polname-atexpr-numerical-expression">
-<span id="polevalatexpr"></span><h2><a class="toc-backref" href="#id143"><span class="docutils literal"><span class="pre">\PolEval{polname}\AtExpr{numerical</span> expression}</span></a></h2>
-<blockquote>
-<p>It boils down to
-<span class="docutils literal">\xinttheexpr polname(numerical <span class="pre">expression)\relax</span></span>.</p>
-</blockquote>
-</div>
-<div class="section" id="poleval-polname-at-fraction">
-<span id="polevalat"></span><h2><a class="toc-backref" href="#id144"><span class="docutils literal"><span class="pre">\PolEval{polname}\At{fraction}</span></span></a></h2>
+<div class="section" id="poldiff-polname-1-polname-2">
+<span id="poldiff"></span><h2><a class="toc-backref" href="#id131"><span class="docutils literal"><span class="pre">\PolDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></h2>
<blockquote>
-<p>Evaluates the polynomial at value <span class="docutils literal">fraction</span> which must be in (or
-expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.</p>
+<p>This sets <span class="docutils literal">polname_2</span> to the first derivative of <span class="docutils literal">polname_1</span>. It
+is allowed to issue <span class="docutils literal"><span class="pre">\PolDiff{f}{f}</span></span>, effectively replacing <span class="docutils literal">f</span>
+by <span class="docutils literal">f'</span>.</p>
+<p>Coefficients of the result <span class="docutils literal">polname_2</span> are irreducible fractions
+(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
</blockquote>
</div>
-<div class="section" id="polevalreduced-polname-atexpr-numerical-expression">
-<span id="polevalreducedatexpr"></span><h2><a class="toc-backref" href="#id145"><span class="docutils literal"><span class="pre">\PolEvalReduced{polname}\AtExpr{numerical</span> expression}</span></a></h2>
+<div class="section" id="poldiff-n-polname-1-polname-2">
+<span id="poldiff-n"></span><h2><a class="toc-backref" href="#id132"><span class="docutils literal"><span class="pre">\PolDiff[N]{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></h2>
<blockquote>
-<p>Boils down to <span class="docutils literal">\xinttheexpr reduce(polname(numerical <span class="pre">expression))\relax</span></span>.</p>
+<p>This sets <span class="docutils literal">polname_2</span> to the <span class="docutils literal">N</span>-th derivative of <span class="docutils literal">polname_1</span>.
+Identical arguments is allowed. With <span class="docutils literal">N=0</span>, same effect as
+<span class="docutils literal"><span class="pre">\PolLet{&lt;polname_2&gt;}={&lt;polname_1&gt;}</span></span>. With negative <span class="docutils literal">N</span>, switches to
+using <span class="docutils literal">\PolAntiDiff</span>.</p>
</blockquote>
</div>
-<div class="section" id="polevalreduced-polname-at-fraction">
-<span id="polevalreducedat"></span><h2><a class="toc-backref" href="#id146"><span class="docutils literal"><span class="pre">\PolEvalReduced{polname}\At{fraction}</span></span></a></h2>
+<div class="section" id="polantidiff-polname-1-polname-2">
+<span id="polantidiff"></span><h2><a class="toc-backref" href="#id133"><span class="docutils literal"><span class="pre">\PolAntiDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></h2>
<blockquote>
-<p>Evaluates the polynomial at value <span class="docutils literal">fraction</span> which must be in (or
-expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros, and produce
-an irreducible fraction.</p>
+<p>This sets <span class="docutils literal">polname_2</span> to the primitive of <span class="docutils literal">polname_1</span> vanishing
+at zero.</p>
+<p>Coefficients of the result <span class="docutils literal">polname_2</span> are irreducible fractions
+(see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p>
</blockquote>
</div>
-<div class="section" id="polfloateval-polname-atexpr-numerical-expression">
-<span id="polfloatevalatexpr"></span><h2><a class="toc-backref" href="#id147"><span class="docutils literal"><span class="pre">\PolFloatEval{polname}\AtExpr{numerical</span> expression}</span></a></h2>
+<div class="section" id="polantidiff-n-polname-1-polname-2">
+<span id="polantidiff-n"></span><h2><a class="toc-backref" href="#id134"><span class="docutils literal"><span class="pre">\PolAntiDiff[N]{&lt;polname_1&gt;}{&lt;polname_2&gt;}</span></span></a></h2>
<blockquote>
-<p>Boils down to <span class="docutils literal">\xintthefloatexpr polname(numerical <span class="pre">expression)\relax</span></span>.</p>
-<p>This is done via a Horner Scheme (see <a class="reference internal" href="#poldef">\poldef</a> and
-<a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>), with already rounded
-coefficients. <a class="footnote-reference brackets" href="#id27" id="id25">4</a> To use the <em>exact coefficients</em> with <em>exactly
-executed</em> additions and multiplications, just insert it in the float
-expression as in this example: <a class="footnote-reference brackets" href="#id28" id="id26">5</a></p>
-<pre class="literal-block">\xintthefloatexpr 3.27*\xintexpr f(2.53)\relax^2\relax</pre>
-<p>The <span class="docutils literal">f(2.53)</span> is exactly computed then rounded at the time of
-getting raised to the power <span class="docutils literal">2</span>. Moving the <span class="docutils literal">^2</span> inside, that
-operation would also be treated exactly.</p>
-<dl class="footnote brackets">
-<dt class="label" id="id27"><span class="brackets"><a class="fn-backref" href="#id25">4</a></span></dt>
-<dd><p>Anyway each floating point operation starts by rounding its
-operands to the floating point precision.</p>
-</dd>
-<dt class="label" id="id28"><span class="brackets"><a class="fn-backref" href="#id26">5</a></span></dt>
-<dd><p>The <span class="docutils literal">\xintexpr</span> here could be <span class="docutils literal">\xinttheexpr</span> but that
-would be less efficient. Cf. <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> documentation about
-nested expressions.</p>
-</dd>
-</dl>
+<p>This sets <span class="docutils literal">polname_2</span> to the result of <span class="docutils literal">N</span> successive integrations on
+<span class="docutils literal">polname_1</span>. With negative <span class="docutils literal">N</span>, it switches to using <span class="docutils literal">\PolDiff</span>.</p>
</blockquote>
</div>
-<div class="section" id="polfloateval-polname-at-fraction">
-<span id="polfloatevalat"></span><h2><a class="toc-backref" href="#id148"><span class="docutils literal"><span class="pre">\PolFloatEval{polname}\At{fraction}</span></span></a></h2>
+<div class="section" id="poldivide-polname-1-polname-2-polname-q-polname-r">
+<span id="poldivide"></span><h2><a class="toc-backref" href="#id135"><span class="docutils literal"><span class="pre">\PolDivide{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_Q&gt;}{&lt;polname_R&gt;}</span></span></a></h2>
<blockquote>
-<p>Evaluates the polynomial at value <span class="docutils literal">fraction</span> which must be in (or
-expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros, and produces
-a floating point number.</p>
+<p>This sets <span class="docutils literal">polname_Q</span> and <span class="docutils literal">polname_R</span> to be the quotient and
+remainder in the Euclidean division of <span class="docutils literal">polname_1</span> by
+<span class="docutils literal">polname_2</span>.</p>
</blockquote>
</div>
-<div class="section" id="polifcoeffisplusorminusone-a-b">
-<span id="polifcoeffisplusorminusone"></span><h2><a class="toc-backref" href="#id149"><span class="docutils literal"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{A}{B}</span></span></a></h2>
+<div class="section" id="polquo-polname-1-polname-2-polname-q">
+<span id="polquo"></span><h2><a class="toc-backref" href="#id136"><span class="docutils literal"><span class="pre">\PolQuo{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_Q&gt;}</span></span></a></h2>
<blockquote>
-<p>This macro is a priori undefined.</p>
-<p>It is defined via the default <a class="reference internal" href="#poltypesetcmd-raw-coeff">\PolTypesetCmd{raw_coeff}</a> to be
-used if needed in the execution of <a class="reference internal" href="#poltypesetmonomialcmd">\PolTypesetMonomialCmd</a>,
-e.g. to insert a <span class="docutils literal">\cdot</span> in front of <span class="docutils literal"><span class="pre">\PolVar^{\PolIndex}</span></span> if
-the coefficient is not plus or minus one.</p>
-<p>The macro will execute <span class="docutils literal">A</span> if the coefficient has been found to be
-plus or minus one, and <span class="docutils literal">B</span> if not.</p>
+<p>This sets <span class="docutils literal">polname_Q</span> to be the quotient in the Euclidean division
+of <span class="docutils literal">polname_1</span> by <span class="docutils literal">polname_2</span>.</p>
</blockquote>
</div>
-<div class="section" id="polleadingcoeff-polname">
-<span id="polleadingcoeff"></span><h2><a class="toc-backref" href="#id150"><span class="docutils literal">\PolLeadingCoeff{polname}</span></a></h2>
+<div class="section" id="polrem-polname-1-polname-2-polname-r">
+<span id="polrem"></span><h2><a class="toc-backref" href="#id137"><span class="docutils literal"><span class="pre">\PolRem{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_R&gt;}</span></span></a></h2>
<blockquote>
-<p>Expands to the leading coefficient.</p>
+<p>This sets <span class="docutils literal">polname_R</span> to be the remainder in the Euclidean division
+of <span class="docutils literal">polname_1</span> by <span class="docutils literal">polname_2</span>.</p>
</blockquote>
</div>
-<div class="section" id="polnthcoeff-polname-number">
-<span id="polnthcoeff"></span><h2><a class="toc-backref" href="#id151"><span class="docutils literal"><span class="pre">\PolNthCoeff{polname}{number}</span></span></a></h2>
+<div class="section" id="polgcd-polname-1-polname-2-polname-gcd">
+<span id="polgcd"></span><h2><a class="toc-backref" href="#id138"><span class="docutils literal"><span class="pre">\PolGCD{&lt;polname_1&gt;}{&lt;polname_2&gt;}{&lt;polname_GCD&gt;}</span></span></a></h2>
<blockquote>
-<p>It expands to the raw <span class="docutils literal">N</span>-th coefficient (<span class="docutils literal">0/1[0]</span> if the index
-number is out of range). With <span class="docutils literal"><span class="pre">N=-1</span></span>, <span class="docutils literal"><span class="pre">-2</span></span>, ... expands to the
-leading coefficients.</p>
+<p>This sets <span class="docutils literal">polname_GCD</span> to be the (monic) GCD of <span class="docutils literal">polname_1</span>
+and <span class="docutils literal">polname_2</span>. It is a unitary polynomial except if both
+<span class="docutils literal">polname_1</span> and <span class="docutils literal">polname_2</span> vanish, then <span class="docutils literal">polname_GCD</span> is the
+zero polynomial.</p>
</blockquote>
</div>
-<div class="section" id="poldegree-polname">
-<span id="poldegree"></span><h2><a class="toc-backref" href="#id152"><span class="docutils literal">\PolDegree{polname}</span></a></h2>
-<blockquote>
-<p>It expands to the degree. This is <span class="docutils literal"><span class="pre">-1</span></span> if zero polynomial but this
-may change in future. Should it then expand to <span class="docutils literal"><span class="pre">-\infty</span></span> ?</p>
-</blockquote>
</div>
-<div class="section" id="policontent-polname">
-<span id="policontent"></span><h2><a class="toc-backref" href="#id153"><span class="docutils literal">\PolIContent{polname}</span></a></h2>
-<blockquote>
-<p>It expands to the contents of the polynomial, i.e. to the positive
-fraction such that dividing by this fraction produces a polynomial
-with integer coefficients having no common prime divisor.</p>
-<p>See <a class="reference internal" href="#polmakeprimitive">\PolMakePrimitive</a>.</p>
-</blockquote>
+<div class="section" id="expandable-macros">
+<h1><a class="toc-backref" href="#id139">Expandable macros</a></h1>
+<div class="admonition note">
+<p class="admonition-title">Note</p>
+<p>At <span class="docutils literal">0.8</span> <span class="docutils literal">polexpr</span> is usable with Plain TeX and not only with
+LaTeX. Some examples given in this section may be using LaTeX syntax
+such as <span class="docutils literal">\renewcommand</span>. Convert to TeX primitives as appropriate
+if testing with a non LaTeX macro format.</p>
</div>
+<p>These macros expand completely in two steps except <span class="docutils literal">\PolToExpr</span> and
+<span class="docutils literal">\PolToFloatExpr</span> which need a <span class="docutils literal">\write</span>, <span class="docutils literal">\edef</span> or a
+<span class="docutils literal"><span class="pre">\csname...\endcsname</span></span> context.</p>
<div class="section" id="poltoexpr-pol-expr">
-<span id="poltoexpr"></span><h2><a class="toc-backref" href="#id154"><span class="docutils literal"><span class="pre">\PolToExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<span id="poltoexpr"></span><h2><a class="toc-backref" href="#id140"><span class="docutils literal"><span class="pre">\PolToExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
-<p>Produces expandably <a class="footnote-reference brackets" href="#id30" id="id29">6</a> the string <span class="docutils literal"><span class="pre">coeff_N*x^N+...</span></span>, i.e. the
+<p>Produces expandably <a class="footnote-reference brackets" href="#id26" id="id25">4</a> the string <span class="docutils literal"><span class="pre">coeff_N*x^N+...</span></span>, i.e. the
polynomial is using descending powers.</p>
<dl class="footnote brackets">
-<dt class="label" id="id30"><span class="brackets"><a class="fn-backref" href="#id29">6</a></span></dt>
+<dt class="label" id="id26"><span class="brackets"><a class="fn-backref" href="#id25">4</a></span></dt>
<dd><p>requires exhaustive expansion, for example as triggered by
<span class="docutils literal">\write</span> or <span class="docutils literal">\edef</span>.</p>
</dd>
@@ -3096,14 +3121,14 @@ is not supposed to be a typesetting macro.</p></li>
<p>Complete customization is possible, see the next macros. Any user
redefinition must maintain the expandability property.</p>
</blockquote>
-<div class="section" id="id31">
-<span id="poltoexprvar"></span><h3><a class="toc-backref" href="#id155"><span class="docutils literal">\PolToExprVar</span></a></h3>
+<div class="section" id="id27">
+<span id="poltoexprvar"></span><h3><a class="toc-backref" href="#id141"><span class="docutils literal">\PolToExprVar</span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal">x</span>. The letter used in input.</p>
</blockquote>
</div>
<div class="section" id="poltoexprinvar">
-<h3><a class="toc-backref" href="#id156"><span class="docutils literal">\PolToExprInVar</span></a></h3>
+<h3><a class="toc-backref" href="#id142"><span class="docutils literal">\PolToExprInVar</span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal">x</span>: the letter used as the polynomial indeterminate.</p>
<p>Recall that declared polynomials are more efficiently used in
@@ -3113,14 +3138,14 @@ have to contain any <span class="docutils literal">x</span>.</p>
<p>(new with <span class="docutils literal">0.8</span>)</p>
</blockquote>
</div>
-<div class="section" id="id32">
-<span id="poltoexprtimes"></span><h3><a class="toc-backref" href="#id157"><span class="docutils literal">\PolToExprTimes</span></a></h3>
+<div class="section" id="id28">
+<span id="poltoexprtimes"></span><h3><a class="toc-backref" href="#id143"><span class="docutils literal">\PolToExprTimes</span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal">*</span>.</p>
</blockquote>
</div>
<div class="section" id="poltoexprcaret">
-<h3><a class="toc-backref" href="#id158"><span class="docutils literal">\PolToExprCaret</span></a></h3>
+<h3><a class="toc-backref" href="#id144"><span class="docutils literal">\PolToExprCaret</span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal">^</span> of catcode 12. Set it to
expand to <span class="docutils literal">**</span> for Python compatible output.</p>
@@ -3128,7 +3153,7 @@ expand to <span class="docutils literal">**</span> for Python compatible output
</blockquote>
</div>
<div class="section" id="poltoexprcmd-raw-coeff">
-<span id="poltoexprcmd"></span><h3><a class="toc-backref" href="#id159"><span class="docutils literal">\PolToExprCmd{raw_coeff}</span></a></h3>
+<span id="poltoexprcmd"></span><h3><a class="toc-backref" href="#id145"><span class="docutils literal"><span class="pre">\PolToExprCmd{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
<p>Defaults to <span class="docutils literal"><span class="pre">\xintPRaw{\xintRawWithZeros{#1}}</span></span>.</p>
<p>This means that the coefficient value is printed-out as a fraction
@@ -3146,8 +3171,8 @@ so for example <span class="docutils literal">23.007/2</span> or <span class="do
and not their finite decimal expansion with no denominator.</p>
</blockquote>
</div>
-<div class="section" id="poltoexproneterm-raw-coeff-number">
-<span id="poltoexproneterm"></span><h3><a class="toc-backref" href="#id160"><span class="docutils literal"><span class="pre">\PolToExprOneTerm{raw_coeff}{number}</span></span></a></h3>
+<div class="section" id="poltoexproneterm-raw-coeff-exponent">
+<span id="poltoexproneterm"></span><h3><a class="toc-backref" href="#id146"><span class="docutils literal"><span class="pre">\PolToExprOneTerm{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
<p>This is the macro which from the coefficient and the exponent
produces the corresponding term in output, such as <span class="docutils literal">2/3*x^7</span>.</p>
@@ -3156,14 +3181,14 @@ produces the corresponding term in output, such as <span class="docutils literal
<a class="reference internal" href="#poltoexprcaret">\PolToExprCaret</a>.</p>
</blockquote>
</div>
-<div class="section" id="poltoexpronetermstylea-raw-coeff-number">
-<span id="poltoexpronetermstylea"></span><h3><a class="toc-backref" href="#id161"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{raw_coeff}{number}</span></span></a></h3>
+<div class="section" id="poltoexpronetermstylea-raw-coeff-exponent">
+<span id="poltoexpronetermstylea"></span><h3><a class="toc-backref" href="#id147"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleA{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
<p>This holds the default package meaning of <span class="docutils literal">\PolToExprOneTerm</span>.</p>
</blockquote>
</div>
-<div class="section" id="poltoexpronetermstyleb-raw-coeff-number">
-<span id="poltoexpronetermstyleb"></span><h3><a class="toc-backref" href="#id162"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{raw_coeff}{number}</span></span></a></h3>
+<div class="section" id="poltoexpronetermstyleb-raw-coeff-exponent">
+<span id="poltoexpronetermstyleb"></span><h3><a class="toc-backref" href="#id148"><span class="docutils literal"><span class="pre">\PolToExprOneTermStyleB{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
<p>This holds an alternative meaning, which puts the fractional part of
a coefficient after the monomial, i.e. like this:</p>
@@ -3176,34 +3201,26 @@ To revert to the package default behaviour, issue
</blockquote>
</div>
<div class="section" id="poltoexprtermprefix-raw-coeff">
-<span id="poltoexprtermprefix"></span><h3><a class="toc-backref" href="#id163"><span class="docutils literal">\PolToExprTermPrefix{raw_coeff}</span></a></h3>
+<span id="poltoexprtermprefix"></span><h3><a class="toc-backref" href="#id149"><span class="docutils literal"><span class="pre">\PolToExprTermPrefix{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
<p>It receives as argument the coefficient. Its default behaviour is
to produce a <span class="docutils literal">+</span> if the coefficient is positive, which will thus
serve to separate the monomials in the output. This is to match
-the default for <a class="reference internal" href="#poltoexprcmd-raw-coeff">\PolToExprCmd{raw_coeff}</a> which in case of a
+the default for <a class="reference internal" href="#poltoexprcmd-raw-coeff">\PolToExprCmd{&lt;raw_coeff&gt;}</a> which in case of a
positive coefficient does not output an explicit <span class="docutils literal">+</span> prefix.</p>
</blockquote>
</div>
</div>
-<div class="section" id="id34">
-<span id="id33"></span><h2><a class="toc-backref" href="#id164"><span class="docutils literal"><span class="pre">\PolToExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
-<blockquote>
-<p>Ascending powers: <span class="docutils literal"><span class="pre">coeff_0+coeff_1*x+coeff_2*x^2+...</span></span>.</p>
-<p>Extended at <span class="docutils literal">0.8</span> to accept general expressions as input.</p>
-<p>Customizable with the same macros as for
-<a class="reference internal" href="#poltoexpr-pol-expr">\PolToExpr{&lt;pol. expr.&gt;}</a>.</p>
-</blockquote>
-</div>
<div class="section" id="poltofloatexpr-pol-expr">
-<span id="poltofloatexpr"></span><h2><a class="toc-backref" href="#id165"><span class="docutils literal"><span class="pre">\PolToFloatExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<span id="poltofloatexpr"></span><h2><a class="toc-backref" href="#id150"><span class="docutils literal"><span class="pre">\PolToFloatExpr{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
-<p>Similar to <a class="reference internal" href="#poltoexpr-pol-expr">\PolToExpr{&lt;pol. expr.&gt;}</a> but using <a class="reference external" href="\PolToFloatExprCmd{raw_coeff}">\PolToFloatExprCmd</a> which by default rounds and
+<p>Similar to <a class="reference internal" href="#poltoexpr-pol-expr">\PolToExpr{&lt;pol. expr.&gt;}</a> but using
+<a class="reference internal" href="#poltofloatexprcmd-raw-coeff">\PolToFloatExprCmd{&lt;raw_coeff&gt;}</a> which by default rounds and
converts the coefficients to floating point format.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>This is unrelated to <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a>:
-<a class="reference internal" href="#poltofloatexprcmd-raw-coeff">\PolToFloatExprCmd{raw_coeff}</a> operates on the <em>exact</em>
+<p>This is unrelated to <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{&lt;polname&gt;}</a>:
+<a class="reference internal" href="#poltofloatexprcmd-raw-coeff">\PolToFloatExprCmd{&lt;raw_coeff&gt;}</a> operates on the <em>exact</em>
coefficients anew (and may thus produce something else than
the coefficients of the polynomial function acting
in <span class="docutils literal">\xintfloateval</span> if the floating point precision was changed
@@ -3211,15 +3228,15 @@ in between).</p>
</div>
<p>Extended at <span class="docutils literal">0.8</span> to accept general expressions as input.</p>
</blockquote>
-<div class="section" id="poltofloatexproneterm-raw-coeff-number">
-<span id="poltofloatexproneterm"></span><h3><a class="toc-backref" href="#id166"><span class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{raw_coeff}{number}</span></span></a></h3>
+<div class="section" id="poltofloatexproneterm-raw-coeff-exponent">
+<span id="poltofloatexproneterm"></span><h3><a class="toc-backref" href="#id151"><span class="docutils literal"><span class="pre">\PolToFloatExprOneTerm{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</span></span></a></h3>
<blockquote>
-<p>Similar to <a class="reference external" href="\PolToExprOneTerm{raw_coeff}{number}">\PolToExprOneTerm</a>. But does not treat
+<p>Similar to <a class="reference internal" href="#poltoexproneterm-raw-coeff-exponent">\PolToExprOneTerm{&lt;raw_coeff&gt;}{&lt;exponent&gt;}</a>. But does not treat
especially coefficients equal to plus or minus one.</p>
</blockquote>
</div>
<div class="section" id="poltofloatexprcmd-raw-coeff">
-<span id="id36"></span><h3><a class="toc-backref" href="#id167"><span class="docutils literal">\PolToFloatExprCmd{raw_coeff}</span></a></h3>
+<span id="poltofloatexprcmd"></span><h3><a class="toc-backref" href="#id152"><span class="docutils literal"><span class="pre">\PolToFloatExprCmd{&lt;raw_coeff&gt;}</span></span></a></h3>
<blockquote>
<p>The one-argument macro used by <span class="docutils literal">\PolToFloatExprOneTerm</span>.
It defaults to <span class="docutils literal"><span class="pre">\xintFloat{#1}</span></span>.</p>
@@ -3239,15 +3256,57 @@ in <span class="docutils literal">xintfrac</span> raw format.</p>
</blockquote>
</div>
</div>
-<div class="section" id="id38">
-<span id="id37"></span><h2><a class="toc-backref" href="#id168"><span class="docutils literal"><span class="pre">\PolToFloatExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<div class="section" id="id30">
+<span id="id29"></span><h2><a class="toc-backref" href="#id153"><span class="docutils literal"><span class="pre">\PolToExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<blockquote>
+<p>Ascending powers: <span class="docutils literal"><span class="pre">coeff_0+coeff_1*x+coeff_2*x^2+...</span></span>.</p>
+<p>Extended at <span class="docutils literal">0.8</span> to accept general expressions as input.</p>
+<p>Customizable with the same macros as for
+<a class="reference internal" href="#poltoexpr-pol-expr">\PolToExpr{&lt;pol. expr.&gt;}</a>.</p>
+</blockquote>
+</div>
+<div class="section" id="id32">
+<span id="id31"></span><h2><a class="toc-backref" href="#id154"><span class="docutils literal"><span class="pre">\PolToFloatExpr*{&lt;pol.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
<blockquote>
<p>Ascending powers.</p>
<p>Extended at <span class="docutils literal">0.8</span> to accept general expressions as input.</p>
</blockquote>
</div>
+<div class="section" id="polnthcoeff-polname-index">
+<span id="polnthcoeff"></span><h2><a class="toc-backref" href="#id155"><span class="docutils literal"><span class="pre">\PolNthCoeff{&lt;polname&gt;}{&lt;index&gt;}</span></span></a></h2>
+<blockquote>
+<p>It expands to the raw <span class="docutils literal">N</span>-th coefficient (<span class="docutils literal">N=0</span> corresponds to
+the constant coefficient). If <span class="docutils literal">N</span> is out of range, zero (in its
+default <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> format <span class="docutils literal">0/1[0]</span>) is returned.</p>
+<p>Negative indices <span class="docutils literal"><span class="pre">N=-1</span></span>, <span class="docutils literal"><span class="pre">-2</span></span>, ... return the leading
+coefficient, sub-leading coefficient, ..., and finally <span class="docutils literal">0/1[0]</span>
+for <span class="docutils literal"><span class="pre">N&lt;-1-degree</span></span>.</p>
+</blockquote>
+</div>
+<div class="section" id="polleadingcoeff-polname">
+<span id="polleadingcoeff"></span><h2><a class="toc-backref" href="#id156"><span class="docutils literal"><span class="pre">\PolLeadingCoeff{&lt;polname&gt;}</span></span></a></h2>
+<blockquote>
+<p>Expands to the leading coefficient.</p>
+</blockquote>
+</div>
+<div class="section" id="poldegree-polname">
+<span id="poldegree"></span><h2><a class="toc-backref" href="#id157"><span class="docutils literal"><span class="pre">\PolDegree{&lt;polname&gt;}</span></span></a></h2>
+<blockquote>
+<p>It expands to the degree. This is <span class="docutils literal"><span class="pre">-1</span></span> if zero polynomial but this
+may change in future. Should it then expand to <span class="docutils literal"><span class="pre">-\infty</span></span> ?</p>
+</blockquote>
+</div>
+<div class="section" id="policontent-polname">
+<span id="policontent"></span><h2><a class="toc-backref" href="#id158"><span class="docutils literal"><span class="pre">\PolIContent{&lt;polname&gt;}</span></span></a></h2>
+<blockquote>
+<p>It expands to the contents of the polynomial, i.e. to the positive
+fraction such that dividing by this fraction produces a polynomial
+with integer coefficients having no common prime divisor.</p>
+<p>See <a class="reference internal" href="#polmakeprimitive">\PolMakePrimitive</a>.</p>
+</blockquote>
+</div>
<div class="section" id="poltolist-polname">
-<span id="poltolist"></span><h2><a class="toc-backref" href="#id169"><span class="docutils literal">\PolToList{polname}</span></a></h2>
+<span id="poltolist"></span><h2><a class="toc-backref" href="#id159"><span class="docutils literal"><span class="pre">\PolToList{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
<p>Expands to <span class="docutils literal"><span class="pre">{coeff_0}{coeff_1}...{coeff_N}</span></span> with <span class="docutils literal">N</span> = degree, and
<span class="docutils literal">coeff_N</span> the leading coefficient
@@ -3256,77 +3315,128 @@ empty output.)</p>
</blockquote>
</div>
<div class="section" id="poltocsv-polname">
-<span id="poltocsv"></span><h2><a class="toc-backref" href="#id170"><span class="docutils literal">\PolToCSV{polname}</span></a></h2>
+<span id="poltocsv"></span><h2><a class="toc-backref" href="#id160"><span class="docutils literal"><span class="pre">\PolToCSV{&lt;polname&gt;}</span></span></a></h2>
<blockquote>
<p>Expands to <span class="docutils literal">coeff_0, coeff_1, coeff_2, <span class="pre">.....,</span> coeff_N</span>, starting
with constant term and ending with leading coefficient. Converse
-to <a class="reference internal" href="#polfromcsv-polname-csv">\PolFromCSV</a>.</p>
+to <a class="reference internal" href="#polfromcsv-polname-csv">\PolFromCSV{&lt;polname&gt;}{&lt;csv&gt;}</a>.</p>
+</blockquote>
+</div>
+<div class="section" id="poleval-polname-atexpr-num-expr">
+<span id="polevalatexpr"></span><h2><a class="toc-backref" href="#id161"><span class="docutils literal"><span class="pre">\PolEval{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<blockquote>
+<p>Same output as
+<span class="docutils literal">\xinteval{polname(numerical expression)}</span>.</p>
+</blockquote>
+</div>
+<div class="section" id="poleval-polname-at-value">
+<span id="polevalat"></span><h2><a class="toc-backref" href="#id162"><span class="docutils literal"><span class="pre">\PolEval{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></h2>
+<blockquote>
+<p>Evaluates the polynomial at the given value which must be in (or
+expand to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.</p>
+</blockquote>
+</div>
+<div class="section" id="polevalreduced-polname-atexpr-num-expr">
+<span id="polevalreducedatexpr"></span><h2><a class="toc-backref" href="#id163"><span class="docutils literal"><span class="pre">\PolEvalReduced{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<blockquote>
+<p>Same output as <span class="docutils literal">\xinteval{reduce(polname(numerical <span class="pre">expression))}</span></span>.</p>
+</blockquote>
+</div>
+<div class="section" id="polevalreduced-polname-at-value">
+<span id="polevalreducedat"></span><h2><a class="toc-backref" href="#id164"><span class="docutils literal"><span class="pre">\PolEvalReduced{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></h2>
+<blockquote>
+<p>Evaluates the polynomial at the value which must be in (or expand
+to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros, and outputs an
+irreducible fraction.</p>
+</blockquote>
+</div>
+<div class="section" id="polfloateval-polname-atexpr-num-expr">
+<span id="polfloatevalatexpr"></span><h2><a class="toc-backref" href="#id165"><span class="docutils literal"><span class="pre">\PolFloatEval{&lt;polname&gt;}\AtExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></h2>
+<blockquote>
+<p>Same output as <span class="docutils literal">\xintfloateval{polname(numerical expression)}</span>.</p>
+<div class="admonition attention">
+<p class="admonition-title">Attention!</p>
+<p><a class="reference internal" href="#polgenfloatvariant">\PolGenFloatVariant</a> must have
+been issued before.</p>
+</div>
+<p>To use the <em>exact coefficients</em> with <em>exactly executed</em> additions
+and multiplications and do the rounding only as the final last step,
+the following syntax can be used: <a class="footnote-reference brackets" href="#id34" id="id33">5</a></p>
+<pre class="literal-block">\xintfloateval{3.27*\xintexpr f(2.53)\relax^2}</pre>
+<dl class="footnote brackets">
+<dt class="label" id="id34"><span class="brackets"><a class="fn-backref" href="#id33">5</a></span></dt>
+<dd><p>Cf. <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> documentation about nested expressions.</p>
+</dd>
+</dl>
+</blockquote>
+</div>
+<div class="section" id="polfloateval-polname-at-value">
+<span id="polfloatevalat"></span><h2><a class="toc-backref" href="#id166"><span class="docutils literal"><span class="pre">\PolFloatEval{&lt;polname&gt;}\At{&lt;value&gt;}</span></span></a></h2>
+<blockquote>
+<p>Evaluates the polynomial at the value which must be in (or expand
+to) a format acceptable to the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros.</p>
</blockquote>
</div>
<div class="section" id="expandable-macros-related-to-the-root-localization-routines">
-<h2><a class="toc-backref" href="#id171">Expandable macros related to the root localization routines</a></h2>
+<h2><a class="toc-backref" href="#id167">Expandable macros related to the root localization routines</a></h2>
<div class="section" id="polsturmchainlength-sturmname">
-<span id="polsturmchainlength"></span><h3><a class="toc-backref" href="#id172"><span class="docutils literal">\PolSturmChainLength{sturmname}</span></a></h3>
+<span id="polsturmchainlength"></span><h3><a class="toc-backref" href="#id168"><span class="docutils literal"><span class="pre">\PolSturmChainLength{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>Returns the integer <span class="docutils literal">N</span> such that <span class="docutils literal">sturmname_N</span> is the last one
in the Sturm chain <span class="docutils literal">sturmname_0</span>, <span class="docutils literal">sturmname_1</span>, ...</p>
-<p>See <a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</p>
+<p>See <a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</a>.</p>
</blockquote>
</div>
-<div class="section" id="polsturmifzeroexactlyknown-sturmname-index-a-b">
-<span id="polsturmifzeroexactlyknown"></span><h3><a class="toc-backref" href="#id173"><span class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}</span></span></a></h3>
+<div class="section" id="polsturmifzeroexactlyknown-sturmname-index-t-f">
+<span id="polsturmifzeroexactlyknown"></span><h3><a class="toc-backref" href="#id169"><span class="docutils literal"><span class="pre">\PolSturmIfZeroExactlyKnown{&lt;sturmname&gt;}{&lt;index&gt;}{T}{F}</span></span></a></h3>
<blockquote>
-<p>Executes <span class="docutils literal">A</span> if the <span class="docutils literal">index</span>-th interval reduces to a singleton,
-i.e. the root is known exactly, else <span class="docutils literal">B</span>.</p>
-<div class="admonition note">
-<p class="admonition-title">Note</p>
-<p><span class="docutils literal">index</span> is allowed to be something like <span class="docutils literal">1+2*3</span> as it is fed
-to <span class="docutils literal"><span class="pre">\the\numexpr...\relax</span></span>.</p>
-</div>
+<p>Executes <span class="docutils literal">T</span> if the <span class="docutils literal">index</span>-th interval reduces to a singleton,
+i.e. the root is known exactly, else <span class="docutils literal">F</span>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeroleft-sturmname-index">
-<span id="polsturmisolatedzeroleft"></span><h3><a class="toc-backref" href="#id174"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{sturmname}{index}</span></span></a></h3>
+<span id="polsturmisolatedzeroleft"></span><h3><a class="toc-backref" href="#id170"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroLeft{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the left end-point for the <span class="docutils literal">index</span>-th interval, as
-computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a>.</p>
+computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
-<p>Of course, this is kept updated by macros such as
-<a class="reference internal" href="#polrefineinterval-n">\PolRefineInterval{sturmname}{index}</a>.</p>
+<p>Execution of this macro after some
+<a class="reference internal" href="#polrefineinterval-n">\PolRefineInterval{&lt;sturmname&gt;}{&lt;index&gt;}</a>
+will take into account the now known tighter bounds.</p>
</div>
<p>The value is pre-formatted using <a class="reference internal" href="#poldectostring">\PolDecTostring</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeroright-sturmname-index">
-<span id="polsturmisolatedzeroright"></span><h3><a class="toc-backref" href="#id175"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{sturmname}{index}</span></span></a></h3>
+<span id="polsturmisolatedzeroright"></span><h3><a class="toc-backref" href="#id171"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroRight{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the right end-point for the <span class="docutils literal">index</span>-th interval as
-computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> and
+computed by some earlier <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> and
possibly refined afterwards.</p>
<p>The value is pre-formatted using <a class="reference internal" href="#poldectostring">\PolDecTostring</a>.</p>
</blockquote>
</div>
<div class="section" id="polsturmisolatedzeromultiplicity-sturmname-index">
-<span id="polsturmisolatedzeromultiplicity"></span><h3><a class="toc-backref" href="#id176"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</span></span></a></h3>
+<span id="polsturmisolatedzeromultiplicity"></span><h3><a class="toc-backref" href="#id172"><span class="docutils literal"><span class="pre">\PolSturmIsolatedZeroMultiplicity{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the multiplicity of the unique root contained in the
<span class="docutils literal">index</span>-th interval.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p>A prior execution of <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{sturmname}</a> is mandatory.</p>
+<p>A prior execution of <a class="reference internal" href="#id15">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</a> is mandatory.</p>
</div>
<p>See <a class="reference internal" href="#the-degree-nine-polynomial-with-0-99-0-999-0-9999-as-triple-roots">The degree nine polynomial with 0.99, 0.999, 0.9999 as triple
roots</a> for an example of use.</p>
</blockquote>
</div>
<div class="section" id="polsturmnbofisolatedzeros-sturmname">
-<span id="polsturmnbofisolatedzeros"></span><h3><a class="toc-backref" href="#id177"><span class="docutils literal">\PolSturmNbOfIsolatedZeros{sturmname}</span></a></h3>
+<span id="polsturmnbofisolatedzeros"></span><h3><a class="toc-backref" href="#id173"><span class="docutils literal"><span class="pre">\PolSturmNbOfIsolatedZeros{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number of real roots of the polynomial
<span class="docutils literal">&lt;sturmname&gt;_0</span>, i.e. the number of distinct real roots of the
polynomial originally used to create the Sturm chain via
-<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{polname}{sturmname}</a>.</p>
+<a class="reference internal" href="#poltosturm-polname-sturmname">\PolToSturm{&lt;polname&gt;}{&lt;sturmname&gt;}</a>.</p>
</blockquote>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
@@ -3338,167 +3448,159 @@ documented package macros anyway.</p>
</div>
</div>
<div class="section" id="polsturmnbofrootsof-sturmname-lessthanorequalto-value">
-<h3><a class="toc-backref" href="#id178"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></span></a></h3>
+<h3><a class="toc-backref" href="#id174"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number of distinct roots (of the polynomial used to
create the Sturm chain) less than or equal to the <span class="docutils literal">value</span> (i.e. a
number of fraction recognizable by the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros).</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
-<p>And the argument is a <span class="docutils literal">sturmname</span>, not a <span class="docutils literal">polname</span> (this is
+<p>And the argument is a <span class="docutils literal">&lt;sturmname&gt;</span>, not a <span class="docutils literal">&lt;polname&gt;</span> (this is
why the macro contains Sturm in its name), simply to be reminded
of the above constraint.</p>
</div>
</blockquote>
</div>
-<div class="section" id="polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">
-<h3><a class="toc-backref" href="#id179"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></span></a></h3>
+<div class="section" id="polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-num-expr">
+<span id="polsturmnbofrootsof"></span><h3><a class="toc-backref" href="#id175"><span class="docutils literal"><span class="pre">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number of distinct roots (of the polynomial
used to create the Sturm chain) which are less than or equal to the
-given <span class="docutils literal">expression</span>.</p>
+given numerical expression.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">
-<h3><a class="toc-backref" href="#id180"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</span></span></a></h3>
+<h3><a class="toc-backref" href="#id176"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number counted with multiplicities of the roots (of
the polynomial used to create the Sturm chain) which are less than
or equal to the given <span class="docutils literal">value</span>.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id15">\PolSturmIsolateZeros*{sturmname}</a> (or the double starred
+<p><a class="reference internal" href="#id15">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</a> (or the double starred
variant) must have been executed beforehand.</p>
</div>
</blockquote>
</div>
-<div class="section" id="polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression">
-<h3><a class="toc-backref" href="#id181"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</span></span></a></h3>
+<div class="section" id="polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-num-expr">
+<h3><a class="toc-backref" href="#id177"><span class="docutils literal"><span class="pre">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num.</span> <span class="pre">expr.&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the total number of roots (counted with multiplicities)
which are less than or equal to the given <span class="docutils literal">expression</span>.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id15">\PolSturmIsolateZeros*{sturmname}</a> (or the double starred
+<p><a class="reference internal" href="#id15">\PolSturmIsolateZeros*{&lt;sturmname&gt;}</a> (or the double starred
variant) must have been executed beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbofrationalroots-sturmname">
-<h3><a class="toc-backref" href="#id182"><span class="docutils literal">\PolSturmNbOfRationalRoots{sturmname}</span></a></h3>
+<h3><a class="toc-backref" href="#id178"><span class="docutils literal"><span class="pre">\PolSturmNbOfRationalRoots{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number of rational roots (without multiplicities).</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmnbofrationalrootswithmultiplicities-sturmname">
-<h3><a class="toc-backref" href="#id183"><span class="docutils literal">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</span></a></h3>
+<h3><a class="toc-backref" href="#id179"><span class="docutils literal"><span class="pre">\PolSturmNbOfRationalRootsWithMultiplicities{&lt;sturmname&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the number of rational roots (counted with multiplicities).</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalroot-sturmname-k">
-<h3><a class="toc-backref" href="#id184"><span class="docutils literal"><span class="pre">\PolSturmRationalRoot{sturmname}{k}</span></span></a></h3>
+<h3><a class="toc-backref" href="#id180"><span class="docutils literal"><span class="pre">\PolSturmRationalRoot{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></h3>
<blockquote>
-<p>Expands to the <span class="docutils literal">k</span>th rational root (they are ordered and indexed
-starting at 1 for the most negative).</p>
+<p>Expands to the k-th rational root. They are enumerated from left to
+right starting at index value <span class="docutils literal">1</span>.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalrootindex-sturmname-k">
-<h3><a class="toc-backref" href="#id185"><span class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{sturmname}{k}</span></span></a></h3>
+<h3><a class="toc-backref" href="#id181"><span class="docutils literal"><span class="pre">\PolSturmRationalRootIndex{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></h3>
<blockquote>
-<p>Expands to <span class="docutils literal">index</span> of the <span class="docutils literal">k</span>th rational root as part of the
-ordered real roots (without multiplicities). I.e., above macro
-<a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{sturmname}{k}</a> is equivalent to this
-nested call:</p>
-<pre class="literal-block">\PolSturmIsolatedZeroLeft{sturmname}{\PolSturmRationalRootIndex{sturmname}{k}}</pre>
+<p>Expands to the index of the <span class="docutils literal">k</span>th rational root as part of the
+ordered real roots (counted without multiplicities). So
+<a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{&lt;sturmname&gt;}{&lt;k&gt;}</a> is equivalent to
+this nested call:</p>
+<pre class="literal-block">\PolSturmIsolatedZeroLeft{&lt;sturmname&gt;}{\PolSturmRationalRootIndex{&lt;sturmname&gt;}{&lt;k&gt;}}</pre>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polsturmrationalrootmultiplicity-sturmname-k">
-<h3><a class="toc-backref" href="#id186"><span class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{sturmname}{k}</span></span></a></h3>
+<h3><a class="toc-backref" href="#id182"><span class="docutils literal"><span class="pre">\PolSturmRationalRootMultiplicity{&lt;sturmname&gt;}{&lt;k&gt;}</span></span></a></h3>
<blockquote>
<p>Expands to the multiplicity of the <span class="docutils literal">k</span>th rational root.</p>
<div class="admonition attention">
<p class="admonition-title">Attention!</p>
-<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a> must have been executed
+<p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a> must have been executed
beforehand.</p>
</div>
</blockquote>
</div>
<div class="section" id="polintervalwidth-sturmname-index">
-<span id="polintervalwidth"></span><h3><a class="toc-backref" href="#id187"><span class="docutils literal"><span class="pre">\PolIntervalWidth{sturmname}{index}</span></span></a></h3>
+<span id="polintervalwidth"></span><h3><a class="toc-backref" href="#id183"><span class="docutils literal"><span class="pre">\PolIntervalWidth{&lt;sturmname&gt;}{&lt;index&gt;}</span></span></a></h3>
<blockquote>
<p>The <span class="docutils literal">10^E</span> width of the current <span class="docutils literal">index</span>-th root localization
interval. Output is in <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> raw <span class="docutils literal">1/1[E]</span> format (if not zero).</p>
</blockquote>
</div>
-</div>
<div class="section" id="expandable-macros-for-use-within-execution-of-polprintintervals">
-<h2><a class="toc-backref" href="#id188">Expandable macros for use within execution of <span class="docutils literal">\PolPrintIntervals</span></a></h2>
+<h3><a class="toc-backref" href="#id184">Expandable macros for use within execution of <span class="docutils literal">\PolPrintIntervals</span></a></h3>
<p>These macros are for usage within custom user redefinitions of
<a class="reference internal" href="#polprintintervalsknownroot">\PolPrintIntervalsKnownRoot</a>, <a class="reference internal" href="#polprintintervalsunknownroot">\PolPrintIntervalsUnknownRoot</a>, or
in redefinitions of <a class="reference internal" href="#polprintintervalsprintexactzero">PolPrintIntervalsPrintExactZero</a> (used in the
default for the former) and of <a class="reference internal" href="#polprintintervalsprintleftendpoint">\PolPrintIntervalsPrintLeftEndPoint</a>,
<a class="reference internal" href="#polprintintervalsprintrightendpoint">\PolPrintIntervalsPrintRightEndPoint</a> (used in the default for the
latter).</p>
-<div class="admonition attention">
-<p class="admonition-title">Attention!</p>
-<p>Some macros formerly mentioned here got removed at 0.7:
-<span class="docutils literal">\PolPrintIntervalsTheEndPoint</span>,
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsPositive{A}{B}</span></span>,
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsNegative{A}{B}</span></span>,
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsZero{A}{B}</span></span>.</p>
</div>
<div class="section" id="polprintintervalsthevar">
-<h3><a class="toc-backref" href="#id189"><span class="docutils literal">\PolPrintIntervalsTheVar</span></a></h3>
+<h3><a class="toc-backref" href="#id185"><span class="docutils literal">\PolPrintIntervalsTheVar</span></a></h3>
<blockquote>
<p>Expands to the name (default <span class="docutils literal">Z</span>) used for representing the roots,
which was passed as optional argument <span class="docutils literal">varname</span> to
-<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a>.</p>
+<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[&lt;varname&gt;]{&lt;sturmname&gt;}</a>.</p>
</blockquote>
</div>
<div class="section" id="polprintintervalstheindex">
-<h3><a class="toc-backref" href="#id190"><span class="docutils literal">\PolPrintIntervalsTheIndex</span></a></h3>
+<h3><a class="toc-backref" href="#id186"><span class="docutils literal">\PolPrintIntervalsTheIndex</span></a></h3>
<blockquote>
<p>Expands to the index of the considered interval (indexing starting
at 1 for the leftmost interval).</p>
</blockquote>
</div>
<div class="section" id="polprintintervalsthesturmname">
-<h3><a class="toc-backref" href="#id191"><span class="docutils literal">\PolPrintIntervalsTheSturmName</span></a></h3>
+<h3><a class="toc-backref" href="#id187"><span class="docutils literal">\PolPrintIntervalsTheSturmName</span></a></h3>
<blockquote>
-<p>Expands to the argument which was passed as <span class="docutils literal">sturmname</span> to
-<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a>.</p>
+<p>Expands to the argument which was passed as <span class="docutils literal">&lt;sturmname&gt;</span> to
+<a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[&lt;varname&gt;]{&lt;sturmname&gt;}</a>.</p>
</blockquote>
</div>
<div class="section" id="polprintintervalstheleftendpoint">
-<h3><a class="toc-backref" href="#id192"><span class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</span></a></h3>
+<h3><a class="toc-backref" href="#id188"><span class="docutils literal">\PolPrintIntervalsTheLeftEndPoint</span></a></h3>
<blockquote>
<p>The left end point of the interval, as would be produced by
<a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft</a> if it was
@@ -3508,7 +3610,7 @@ by <a class="reference internal" href="#polprintintervalsthesturmname">\PolPrint
</blockquote>
</div>
<div class="section" id="polprintintervalstherightendpoint">
-<h3><a class="toc-backref" href="#id193"><span class="docutils literal">\PolPrintIntervalsTheRightEndPoint</span></a></h3>
+<h3><a class="toc-backref" href="#id189"><span class="docutils literal">\PolPrintIntervalsTheRightEndPoint</span></a></h3>
<blockquote>
<p>The right end point of the interval, as would be produced by
<a class="reference internal" href="#polsturmisolatedzeroright">\PolSturmIsolatedZeroRight</a> for
@@ -3516,7 +3618,7 @@ this Sturm chain name and index.</p>
</blockquote>
</div>
<div class="section" id="polprintintervalsthemultiplicity">
-<h3><a class="toc-backref" href="#id194"><span class="docutils literal">\PolPrintIntervalsTheMultiplicity</span></a></h3>
+<h3><a class="toc-backref" href="#id190"><span class="docutils literal">\PolPrintIntervalsTheMultiplicity</span></a></h3>
<blockquote>
<p>The multiplicity of the unique root within the interval of index
<a class="reference internal" href="#polprintintervalstheindex">\PolPrintIntervalsTheIndex</a>. Makes sense only if the starred (or
@@ -3526,9 +3628,9 @@ double-starred) variant of <a class="reference internal" href="#polsturmisolatez
</div>
</div>
<div class="section" id="booleans-with-default-setting-as-indicated">
-<h1><a class="toc-backref" href="#id195">Booleans (with default setting as indicated)</a></h1>
+<h1><a class="toc-backref" href="#id191">Booleans (with default setting as indicated)</a></h1>
<div class="section" id="xintverbosefalse">
-<h2><a class="toc-backref" href="#id196"><span class="docutils literal">\xintverbosefalse</span></a></h2>
+<h2><a class="toc-backref" href="#id192"><span class="docutils literal">\xintverbosefalse</span></a></h2>
<blockquote>
<p>This is actually an <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> configuration. Setting it to
<span class="docutils literal">true</span> triggers the writing of information to the log when new
@@ -3541,14 +3643,14 @@ considered unstable and undocumented internal structures.</p>
</blockquote>
</div>
<div class="section" id="polnewpolverbosefalse">
-<h2><a class="toc-backref" href="#id197"><span class="docutils literal">\polnewpolverbosefalse</span></a></h2>
+<h2><a class="toc-backref" href="#id193"><span class="docutils literal">\polnewpolverbosefalse</span></a></h2>
<blockquote>
<p>When <span class="docutils literal">\poldef</span> is used, both a variable and a function are
defined. The default <span class="docutils literal">\polnewpolverbosefalse</span> setting suppresses
the print-out to the log and terminal of the function macro meaning,
as it only duplicates the information contained in the variable
which is already printed out to the log and terminal.</p>
-<p>However <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{polname}</a> does still print out the
+<p>However <a class="reference internal" href="#polgenfloatvariant-polname">\PolGenFloatVariant{&lt;polname&gt;}</a> does still print out the
information relative to the polynomial function it defines for use in
<span class="docutils literal">\xintfloateval{}</span> as there is no float polynomial variable, only the
function, and it is the only way to see its rounded coefficients
@@ -3561,14 +3663,14 @@ roots obey only the <span class="docutils literal"><span class="pre">\xintverbos
</blockquote>
</div>
<div class="section" id="poltypesetallfalse">
-<h2><a class="toc-backref" href="#id198"><span class="docutils literal">\poltypesetallfalse</span></a></h2>
+<h2><a class="toc-backref" href="#id194"><span class="docutils literal">\poltypesetallfalse</span></a></h2>
<blockquote>
<p>If <span class="docutils literal">true</span>, <a class="reference internal" href="#poltypeset">\PolTypeset</a> will also typeset the vanishing
coefficients.</p>
</blockquote>
</div>
<div class="section" id="poltoexprallfalse">
-<h2><a class="toc-backref" href="#id199"><span class="docutils literal">\poltoexprallfalse</span></a></h2>
+<h2><a class="toc-backref" href="#id195"><span class="docutils literal">\poltoexprallfalse</span></a></h2>
<blockquote>
<p>If <span class="docutils literal">true</span>, <a class="reference internal" href="#poltoexpr-pol-expr">\PolToExpr{&lt;pol. expr.&gt;}</a> and <a class="reference internal" href="#poltofloatexpr-pol-expr">\PolToFloatExpr{&lt;pol. expr.&gt;}</a> will
also include the vanishing coefficients in their outputs.</p>
@@ -3576,35 +3678,38 @@ also include the vanishing coefficients in their outputs.</p>
</div>
</div>
<div class="section" id="utilies">
-<h1><a class="toc-backref" href="#id200">Utilies</a></h1>
+<h1><a class="toc-backref" href="#id196">Utilies</a></h1>
<div class="section" id="poldectostring-decimal-number">
-<span id="poldectostring"></span><h2><a class="toc-backref" href="#id201"><span class="docutils literal">\PolDecToString{decimal number}</span></a></h2>
+<span id="poldectostring"></span><h2><a class="toc-backref" href="#id197"><span class="docutils literal">\PolDecToString{decimal number}</span></a></h2>
+<blockquote>
+<p>This is a utility macro to print decimal numbers. It is an alias
+for <span class="docutils literal">\xintDecToString</span>.</p>
+</blockquote>
<blockquote>
-<p>This is a utility macro to print decimal numbers. It has been
-backported to <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> (release <span class="docutils literal">1.3</span> of <span class="docutils literal">2018/03/01</span>) under
-the name <span class="docutils literal">\xintDecToString</span>, and the <span class="docutils literal">polexpr</span> macro is simply
-now an alias to it.</p>
<p>For example
<span class="docutils literal"><span class="pre">\PolDecToString{123.456e-8}</span></span> will expand to <span class="docutils literal">0.00000123456</span>
and <span class="docutils literal"><span class="pre">\PolDecToString{123.450e-8}</span></span> to <span class="docutils literal">0.00000123450</span> which
-illustrates that trailing zeros are not trimmed. To trim trailing
-zeroes, one can use <span class="docutils literal"><span class="pre">\PolDecToString{\xintREZ{#1}}</span></span>.</p>
-<p>The precise behaviour of this macro may evolve in future releases of
-<a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a>.</p>
+illustrates that trailing zeros are not trimmed.</p>
+<p>To trim trailing zeroes, one can use
+<span class="docutils literal"><span class="pre">\PolDecToString{\xintREZ{#1}}</span></span>.</p>
+<p>Attention that a.t.t.o.w. if the argument is for example <span class="docutils literal">1/5</span>, the
+macro does not identify that this is in fact a number with a finite
+decimal expansion and it outputs <span class="docutils literal">1/5</span>. See current <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a>
+documentation.</p>
</blockquote>
</div>
<div class="section" id="polexprsetup">
-<h2><a class="toc-backref" href="#id202"><span class="docutils literal">\polexprsetup</span></a></h2>
+<h2><a class="toc-backref" href="#id198"><span class="docutils literal">\polexprsetup</span></a></h2>
<blockquote>
<p>Serves to customize the package. Currently only two keys are
recognized:</p>
<ul class="simple">
-<li><p><span class="docutils literal">norr</span>: the postfix that <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a>
-should append to <span class="docutils literal">sturmname</span> to declare the primitive polynomial
+<li><p><span class="docutils literal">norr</span>: the postfix that <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a>
+should append to <span class="docutils literal">&lt;sturmname&gt;</span> to declare the primitive polynomial
obtained from original one after removal of all rational roots.
The default value is <span class="docutils literal">_norr</span> (standing for “no rational roots”).</p></li>
-<li><p><span class="docutils literal">sqfnorr</span>: the postfix that <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a>
-should append to <span class="docutils literal">sturmname</span> to declare the primitive polynomial
+<li><p><span class="docutils literal">sqfnorr</span>: the postfix that <a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a>
+should append to <span class="docutils literal">&lt;sturmname&gt;</span> to declare the primitive polynomial
obtained from original one after removal of all rational roots and
suppression of all multiplicities.
The default value is <span class="docutils literal">_sqf_norr</span> (standing for “square-free with
@@ -3615,15 +3720,15 @@ no rational roots”).</p></li>
</div>
</div>
<div class="section" id="technicalities">
-<h1><a class="toc-backref" href="#id203">Technicalities</a></h1>
+<h1><a class="toc-backref" href="#id199">Technicalities</a></h1>
<ul>
<li><p>The catcode of the semi-colon is reset temporarily by <a class="reference internal" href="#poldef">\poldef</a> macro in case some other package (for example the French
babel module) may have made it active. This will fail though if the
whole thing was already part of a macro argument, in such cases one
-can use <a class="reference internal" href="#id8">\PolDef{f}{P(x)}</a>
-rather. The colon in <span class="docutils literal">:=</span> may be active with no consequences.</p></li>
+can use <a class="reference internal" href="#id8">\PolDef</a> rather. The colon in <span class="docutils literal">:=</span> may be
+active with no consequences.</p></li>
<li><p>As a consequence of <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> addition and subtraction always using
-least common multiples for the denominators <a class="footnote-reference brackets" href="#id40" id="id39">7</a>, user-chosen common
+least common multiples for the denominators, user-chosen common
denominators survive additions and multiplications. For example, this:</p>
<pre class="literal-block">\poldef P(x):= 1/2 + 2/2*x + 3/2*x^3 + 4/2*x^4;
\poldef Q(x):= 1/3 + (2/3)x + (3/3)x^3 + (4/3)x^4;
@@ -3633,22 +3738,14 @@ denominators survive additions and multiplications. For example, this:</p>
<p>where all coefficients have the same denominator 6. Notice though that
<span class="docutils literal">\PolToExpr{PQ}</span> outputs the <span class="docutils literal">6/6*x^3</span> as <span class="docutils literal">x^3</span> because (by
default) it recognizes and filters out coefficients equal to one or
-minus one (since release <span class="docutils literal">0.3</span>). One can use for example
+minus one. One can use for example
<span class="docutils literal">\PolToCSV{PQ}</span> to see the internally stored coefficients.</p>
-<dl class="footnote brackets">
-<dt class="label" id="id40"><span class="brackets"><a class="fn-backref" href="#id39">7</a></span></dt>
-<dd><p>prior to <span class="docutils literal">0.4.1</span>, <span class="docutils literal">polexpr</span> used to temporarily patch
-during the parsing of polynomials the <a class="reference external" href="http://www.ctan.org/pkg/xint">xintfrac</a> macros. This
-patch was backported to <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> at release <span class="docutils literal">1.3</span>.</p>
-</dd>
-</dl>
</li>
-<li><p><a class="reference internal" href="#poldiff-polname-1-polname-2">\PolDiff{polname_1}{polname_2}</a> always applies <span class="docutils literal">\xintIrr</span> to the
-resulting coefficients, except that the <em>power of ten</em> part <span class="docutils literal">[N]</span>
-(for example an input in scientific notation such as <span class="docutils literal">1.23e5</span> gives
-<span class="docutils literal">123/1[3]</span> internally in xintfrac) is not taken into account in the
-reduction of the fraction. This is tentative and may change.</p>
-<p>Same remark for <a class="reference internal" href="#polantidiff-polname-1-polname-2">\PolAntiDiff{polname_1}{polname_2}</a>.</p>
+<li><p><a class="reference internal" href="#poldiff-polname-1-polname-2">\PolDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</a> always applies <span class="docutils literal">\xintPIrr</span> to the
+resulting coefficients, which means that fractions are reduced to
+lowest terms but ignoring an already separated <em>power of ten</em> part <span class="docutils literal">[N]</span>
+present in the internal representation. This is tentative and may change.</p>
+<p>Same remark for <a class="reference internal" href="#polantidiff-polname-1-polname-2">\PolAntiDiff{&lt;polname_1&gt;}{&lt;polname_2&gt;}</a>.</p>
</li>
<li><p>Currently, the package stores all coefficients from index <span class="docutils literal">0</span> to
index equal to the polynomial degree inside a single macro, as a list.
@@ -3661,7 +3758,7 @@ documented and unstable. Don't use them.</p></li>
</ul>
</div>
<div class="section" id="change-log">
-<h1><a class="toc-backref" href="#id204">CHANGE LOG</a></h1>
+<h1><a class="toc-backref" href="#id200">CHANGE LOG</a></h1>
<ul>
<li><p>v0.1 (2018/01/11): initial release. Features:</p>
<ul class="simple">
@@ -3701,7 +3798,7 @@ using expressions in the second argument.</p>
<ul class="simple">
<li><p><a class="reference internal" href="#poltoexpr">\PolToExpr</a> now by default uses <em>descending</em>
powers (it also treats differently coefficients equal to 1 or -1.)
-Use <a class="reference internal" href="#id33">\PolToExpr*</a> for <em>ascending</em> powers.</p></li>
+Use <a class="reference internal" href="#id29">\PolToExpr*</a> for <em>ascending</em> powers.</p></li>
<li><p><a class="reference internal" href="#polevalat">\PolEval</a> reduced the output to smallest terms,
but as this is costly with big fractions and not needed if e.g.
wrapped in an <span class="docutils literal">\xintRound</span> or <span class="docutils literal">\xintFloat</span>, this step has been
@@ -3718,7 +3815,7 @@ removed; the former meaning is available as <a class="reference internal" href="
<li><p><a class="reference internal" href="#poltoexproneterm">\PolToExprOneTerm</a></p></li>
<li><p><a class="reference internal" href="#poltofloatexproneterm">\PolToFloatExprOneTerm</a></p></li>
<li><p><a class="reference internal" href="#poltoexprcmd">\PolToExprCmd</a></p></li>
-<li><p><a class="reference internal" href="#id36">\PolToFloatExprCmd</a></p></li>
+<li><p><a class="reference internal" href="#poltofloatexprcmd">\PolToFloatExprCmd</a></p></li>
<li><p><a class="reference internal" href="#poltoexprtermprefix">\PolToExprTermPrefix</a></p></li>
<li><p><a class="reference internal" href="#poltoexprvar">\PolToExprVar</a></p></li>
<li><p><a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a></p></li>
@@ -3839,7 +3936,7 @@ for localization of the real roots of polynomials.</p>
<ul class="simple">
<li><p>bug fixes:</p>
<ul>
-<li><p><a class="reference internal" href="#polget-polname-fromarray-macro">\PolGet{polname}\fromarray\macro</a> crashed when <span class="docutils literal">\macro</span> was
+<li><p><a class="reference internal" href="#polget-polname-fromarray-macro">\PolGet{&lt;polname&gt;}\fromarray\macro</a> crashed when <span class="docutils literal">\macro</span> was
an <a class="reference external" href="http://www.ctan.org/pkg/xint">xinttools</a> array macro with no items. It now produces the zero
polynomial.</p></li>
</ul>
@@ -3888,7 +3985,7 @@ an interval specification.</p></li>
<ul class="simple">
<li><p>bugfix:</p>
<ul>
-<li><p>the starred variant <a class="reference internal" href="#id13">\PolToSturm*{polname}{sturmname}</a> was
+<li><p>the starred variant <a class="reference internal" href="#id13">\PolToSturm*{&lt;polname&gt;}{&lt;sturmname&gt;}</a> was
broken. On the occasion of the fix, its meaning has been modified,
see its documentation.</p></li>
<li><p>using <a class="reference internal" href="#poltosturm">\PolToSturm</a> with a constant polynomial
@@ -3903,11 +4000,11 @@ acts like the <a class="reference internal" href="#polsturmisolatezeros">non-sta
</li>
<li><p>new expandable macros:</p>
<ul>
-<li><p><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{sturmname}{index}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-expression">\PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatedzeromultiplicity-sturmname-index">\PolSturmIsolatedZeroMultiplicity{&lt;sturmname&gt;}{&lt;index&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrootsof-sturmname-lessthanorequaltoexpr-num-expr">\PolSturmNbOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num. expr.&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequalto-value">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualTo{&lt;value&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbwithmultofrootsof-sturmname-lessthanorequaltoexpr-num-expr">\PolSturmNbWithMultOfRootsOf{&lt;sturmname&gt;}\LessThanOrEqualToExpr{&lt;num. expr.&gt;}</a></p></li>
</ul>
</li>
</ul>
@@ -3916,32 +4013,32 @@ acts like the <a class="reference internal" href="#polsturmisolatezeros">non-sta
<ul class="simple">
<li><p>breaking changes:</p>
<ul>
-<li><p>although <a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[varname]{sturmname}</a> default output
+<li><p>although <a class="reference internal" href="#polprintintervals-varname-sturmname">\PolPrintIntervals[&lt;varname&gt;]{&lt;sturmname&gt;}</a> default output
remains the same, some auxiliary macros for user-customization
have been removed: <span class="docutils literal">\PolPrintIntervalsTheEndPoint</span>,
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsPositive{A}{B}</span></span>,
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsNegative{A}{B}</span></span>, and
-<span class="docutils literal"><span class="pre">\PolIfEndPointIsZero{A}{B}</span></span>.</p></li>
+<span class="docutils literal"><span class="pre">\PolIfEndPointIsPositive{T}{F}</span></span>,
+<span class="docutils literal"><span class="pre">\PolIfEndPointIsNegative{T}{F}</span></span>, and
+<span class="docutils literal"><span class="pre">\PolIfEndPointIsZero{T}{F}</span></span>.</p></li>
</ul>
</li>
<li><p>bugfix:</p>
<ul>
<li><p>it could happen that, contrarily to documentation, an interval
-computed by <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{sturmname}</a> had zero as an
+computed by <a class="reference internal" href="#polsturmisolatezeros-sturmname">\PolSturmIsolateZeros{&lt;sturmname&gt;}</a> had zero as an
endpoint,</p></li>
-<li><p><a class="reference internal" href="#polensureintervallength-sturmname-index-e">\PolEnsureIntervalLength{sturmname}{index}{E}</a> could under
+<li><p><a class="reference internal" href="#polensureintervallength-sturmname-index-exponent">\PolEnsureIntervalLength{&lt;sturmname&gt;}{&lt;index&gt;}{&lt;exponent&gt;}</a> could under
certain circumstances erroneously replace a non-zero root by
zero,</p></li>
-<li><p><a class="reference internal" href="#polensureintervallengths-sturmname-e">\PolEnsureIntervalLengths{sturmname}{E}</a> crashed when used with
+<li><p><a class="reference internal" href="#polensureintervallengths-sturmname-exponent">\PolEnsureIntervalLengths{&lt;sturmname&gt;}{&lt;exponent&gt;}</a> crashed when used with
a polynomial with no real roots, hence for which no isolation intervals
existed (thanks to Thomas Söll for report).</p></li>
</ul>
</li>
<li><p>new macros:</p>
<ul>
-<li><p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{sturmname}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{sturmname}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname">\PolSturmIsolateZerosAndFindRationalRoots{sturmname}</a></p></li>
+<li><p><a class="reference internal" href="#id17">\PolSturmIsolateZeros**{&lt;sturmname&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots-sturmname">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{&lt;sturmname&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots-sturmname">\PolSturmIsolateZerosAndFindRationalRoots{&lt;sturmname&gt;}</a></p></li>
<li><p><a class="reference internal" href="#polexprsetup">\polexprsetup</a></p></li>
<li><p><a class="reference internal" href="#id21">\PolPrintIntervals*</a></p></li>
<li><p><a class="reference internal" href="#polprintintervalsnorealroots">\PolPrintIntervalsNoRealRoots</a></p></li>
@@ -3954,11 +4051,11 @@ existed (thanks to Thomas Söll for report).</p></li>
</li>
<li><p>new expandable macros:</p>
<ul>
-<li><p><a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{sturmname}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname">\PolSturmNbOfRationalRootsWithMultiplicities{sturmname}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{sturmname}{k}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k">\PolSturmRationalRootIndex{sturmname}{k}</a></p></li>
-<li><p><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k">\PolSturmRationalRootMultiplicity{sturmname}{k}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrationalroots-sturmname">\PolSturmNbOfRationalRoots{&lt;sturmname&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmnbofrationalrootswithmultiplicities-sturmname">\PolSturmNbOfRationalRootsWithMultiplicities{&lt;sturmname&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalroot-sturmname-k">\PolSturmRationalRoot{&lt;sturmname&gt;}{&lt;k&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalrootindex-sturmname-k">\PolSturmRationalRootIndex{&lt;sturmname&gt;}{&lt;k&gt;}</a></p></li>
+<li><p><a class="reference internal" href="#polsturmrationalrootmultiplicity-sturmname-k">\PolSturmRationalRootMultiplicity{&lt;sturmname&gt;}{&lt;k&gt;}</a></p></li>
<li><p><a class="reference internal" href="#polprintintervalsthevar">\PolPrintIntervalsTheVar</a></p></li>
<li><p><a class="reference internal" href="#polprintintervalsthesturmname">\PolPrintIntervalsTheSturmName</a></p></li>
<li><p><a class="reference internal" href="#polprintintervalsthemultiplicity">\PolPrintIntervalsTheMultiplicity</a></p></li>
@@ -4069,10 +4166,38 @@ macro interface such as gcd computations.</p></li>
<p>See the updated <a class="reference internal" href="#quick-syntax-overview">Quick syntax overview</a> and then <a class="reference internal" href="#polexpr08">the extended syntax
description</a>.</p>
</li>
+<li><p>v0.8.1 (2021/04/12)</p>
+<ul class="simple">
+<li><p>breaking changes:</p>
+<ul>
+<li><p>renamed v0.8's <span class="docutils literal">icontent()</span> to <a class="reference internal" href="#cont">cont()</a>.</p></li>
+<li><p>renamed v0.8's <span class="docutils literal">lcoeff()</span> to <a class="reference internal" href="#lc">lc()</a>.</p></li>
+</ul>
+</li>
+<li><p>bugfix:</p>
+<ul>
+<li><p>sadly, <span class="docutils literal">diff1()</span>, <span class="docutils literal">diff2()</span>, <span class="docutils literal">diffn()</span> were broken
+for polynomials of degrees 8 or more, due to a typo and
+insufficient testing.</p></li>
+<li><p>the package should have (as documented) required <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> 1.4d
+but in practice it accepted to work with <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> 1.4c, whose
+<span class="docutils literal">\xinteval</span> does not know how to &quot;output&quot; a polynomial.</p></li>
+<li><p>the definition of one of the two variants of <a class="reference internal" href="#polsturmnbofrootsof">\PolSturmNbOfRootsOf</a> was broken by an end-of-line space, left-over
+from mass conversion from LaTeX to TeX syntax.</p></li>
+</ul>
+</li>
+<li><p>added:</p>
+<ul>
+<li><p><a class="reference internal" href="#lpol">lpol()</a></p></li>
+<li><p><a class="reference internal" href="#lcoeffs">lcoeffs()</a></p></li>
+</ul>
+</li>
+</ul>
+</li>
</ul>
</div>
<div class="section" id="acknowledgments">
-<h1><a class="toc-backref" href="#id205">Acknowledgments</a></h1>
+<h1><a class="toc-backref" href="#id201">Acknowledgments</a></h1>
<p>Thanks to Jürgen Gilg whose question about <a class="reference external" href="http://www.ctan.org/pkg/xint">xintexpr</a> usage for
differentiating polynomials was the initial trigger leading to this
package, and to Jürgen Gilg and Thomas Söll for testing it on some
diff --git a/macros/generic/polexpr/polexpr.sty b/macros/generic/polexpr/polexpr.sty
index c94a4e8d61..420f469cf1 100644
--- a/macros/generic/polexpr/polexpr.sty
+++ b/macros/generic/polexpr/polexpr.sty
@@ -2,7 +2,7 @@
% License: LPPL 1.3c (author-maintained)
% Usage: \input polexpr.sty (Plain or other macro formats)
% or \usepackage{polexpr} (LaTeX macro format)
-% polexpr.sty (this file) inputs:
+% Release 0.8.1 (2021/04/12) of polexpr.sty. This file inputs
% polexprcore.tex
% polexprexpr.tex
% polexprsturm.tex
@@ -43,7 +43,7 @@
% variable is initialized, but \ProvidesPackage not yet seen
\ifx\w\relax % xintexpr.sty not yet loaded.
\expandafter\def\expandafter\z\expandafter
- {\z\RequirePackage{xintexpr}[2021/02/20]}%
+ {\z\RequirePackage{xintexpr}[2021/03/29]}%
\fi
\else
\aftergroup\endinput % polexpr already loaded.
@@ -51,14 +51,14 @@
\fi
\fi
\z%
-\XINTsetupcatcodes%
+\XINTsetupcatcodes% (does \endlinechar13 in particular)
\XINT_providespackage
\ProvidesPackage{polexpr}%
- [2021/03/29 v0.8 Polynomial expressions with rational coefficients (JFB)]%
+ [2021/04/12 v0.8.1 Polynomial expressions with rational coefficients (JFB)]%
\begingroup
\def\x#1/#2/#3 #4\xint:{#1#2#3}%
\ifnum\expandafter\x\expanded{\csname ver@xintexpr.sty\endcsname}\xint:
- <20210220 % actually 20200131 (xint 1.4) is presumably ok
+ <20210329 %
\immediate\write128{! Package polexpr error: xintexpr too old, aborting input}%
\else\expandafter\xint_gobble_i
\fi
@@ -88,7 +88,7 @@
\def\next{\expandafter\endgroup\@tempb}\fi\fi\next
}%
% \polexprsetup added at 0.7
-\catcode`! 3
+\catcode`! 3 %
\def\polexprsetup#1{\POL@setup_parsekeys #1,=!,\xint_bye}%
\def\POL@setup_parsekeys #1=#2#3,{%
\ifx!#2\expandafter\xint_bye\fi
@@ -100,7 +100,7 @@
}%
\def\POL@setup_setkey_norr #1#2{\edef\POL@norr}%
\def\POL@setup_setkey_sqfnorr #1#2{\edef\POL@sqfnorr}%
-\polexprsetup{norr=_norr, sqfnorr=_sqf_norr}
+\polexprsetup{norr=_norr, sqfnorr=_sqf_norr}%
\catcode`! 11 % special catcode for ! as used in xintexpr.sty
%
\newif\ifxintveryverbose
@@ -332,7 +332,7 @@
\POL@defpolfunc{#1}{expr}%
\ifpolnewpolverbose\POL@info{#1}\fi
}%
-\def\PolGlobalLet#1#2{\begingroup\xintglobaldefstrue\PolLet{#1}{#2}\endgroup}
+\def\PolGlobalLet#1#2{\begingroup\xintglobaldefstrue\PolLet{#1}{#2}\endgroup}%
%
\def\PolAssign#1{\def\POL@polname{#1}\POL@assign}% zap spaces in #1?
\def\POL@assign#1\toarray#2{%
@@ -771,7 +771,7 @@
\else
\def\PolTypesetOne{\xintSignedFwOver}%
\fi
-\catcode`^ 7
+\catcode`^ 7 %
\def\PolTypesetMonomialCmd{%
\ifcase\PolIndex\space
%
@@ -906,11 +906,12 @@
\def\PolToCSV#1{\romannumeral0\xintlistwithsep{, }{\PolToList{#1}}}%
%
% \PolIContent (0.5)
-% Why did I call this IContent and not Content? Ah, I see Maple terminology
-% But I realize now I misread the Maple doc, its icontent() is the gcd of
-% all coeffs of a multivariate polynomial. Whereas content(,) second argument
-% specifies which variable to consider expression as being univariate in it
-%
+% Why did I call this IContent and not Content? Ah, I see, Maple terminology!
+% But I realize now I misread in 2018 the Maple doc, its icontent() is the gcd
+% of all coeffs of a multivariate polynomial. Whereas content(,) second argument
+% specifies which variable to consider expression as being univariate in it.
+% Refactored at 0.8 as xint 1.4 has a backported fractional gcd
+% (itself refactored at 1.4d)
\def\POL@icontent#1{\romannumeral0\expandafter\XINT_fgcd_out
\romannumeral0\expandafter\XINT_fgcdof\romannumeral`&&@#1^}%
% Since xintexpr 1.4d, \xintGCDof always outputs an irreducible fraction A/B.
diff --git a/macros/generic/polexpr/polexprcore.tex b/macros/generic/polexpr/polexprcore.tex
index e071729e42..a5c93f0f46 100644
--- a/macros/generic/polexpr/polexprcore.tex
+++ b/macros/generic/polexpr/polexprcore.tex
@@ -1,4 +1,4 @@
-%% This file polexprcore.tex is part of the polexpr package (0.8, 2021/03/29)
+%% This file polexprcore.tex is part of the polexpr package (0.8.1, 2021/04/12)
%% Core routines to match infix operators +, -, *, //, /:, ^, ** and some
%% functions
%% The atoms representing polynomials inside \xintexpr are
@@ -38,29 +38,13 @@
\POL_bBye #7\xint_Bye{#15{#7}}%
\POL_bBye #8\xint_Bye{#16{#8}}%
\POL_bBye #9\xint_Bye{#17{#9}}%
- \POL_apply:x_iloop_a#1%
+ \POL_apply:x_iloop_a #1%
}%
\def\POL_apply:x_iloop_a#1#2.%
{%
\expandafter\POL_apply:x_iloop
- \expandafter{\expandafter#1\the\numexpr\xint_c_viii+#1.}%
-}%
-\long\def\POL_apply:x_iloop #1#2#3#4#5#6#7#8#9%
-{%
- \POL_bBye #2\xint_Bye{#10{#2}}%
- \POL_bBye #3\xint_Bye{#11{#3}}%
- \POL_bBye #4\xint_Bye{#12{#4}}%
- \POL_bBye #5\xint_Bye{#13{#5}}%
- \POL_bBye #6\xint_Bye{#14{#6}}%
- \POL_bBye #7\xint_Bye{#15{#7}}%
- \POL_bBye #8\xint_Bye{#16{#8}}%
- \POL_bBye #9\xint_Bye{#17{#9}}%
- \POL_apply:x_iloop_a#1%
-}%
-\def\POL_apply:x_iloop_a#1#2.%
-{%
- \expandafter\POL_apply:x_iloop
- \expandafter{\expandafter#1\the\numexpr\xint_c_viii+#1.}%
+% arrgggh, 0.8 had +#1 in place of +#2... again I did not test enough
+ \expandafter{\expandafter#1\the\numexpr\xint_c_viii+#2.}%
}%
%%
%% ADDITION
@@ -694,7 +678,7 @@
}%
\def\POL_quorem_ERem_fix_a 0/1[0]#1.#2%
{%
- \ifcase #1
+ \ifcase #1 %
\or
\expandafter\xint_firstofone
\else
@@ -869,6 +853,11 @@
\xint:\xint:\xint:\xint:\xint_bye
\xint_bye
}%
+% 0.8.1 adds \xintPolLPol. Not much to do... as long as I don't worry about
+% empty input... (not motivated about this, there are other such places)
+\def\xintPolLPol#1{\romannumeral`&&@\expandafter\POL_add_d
+ \romannumeral`&&@#1\xint_bye
+}%
% attention to not overwrite macro names (there is a legacy \PolEvalAt)
\def\xintPolEvalAt#1#2%
{%
@@ -948,6 +937,22 @@
% annoying that we had to put this delimiter \xint:
\def\POL_coeffs_pol P#1.#2\xint:{#2}%
%
+\def\xintPolLCoeffs#1%
+{%
+ \romannumeral`&&@\expandafter\POL_lcoeffs_fork
+ \romannumeral`&&@#1\xint:\xint:\xint:\xint:%
+ \xint:\xint:\xint:\xint:\xint_bye
+}%
+\def\POL_lcoeffs_fork #1%
+{%
+ \POL_Pfork
+ #1\POL_lcoeffs_pol
+ P\POL_lcoeffs_cst
+ \krof #1%
+}%
+\def\POL_lcoeffs_cst #1\xint:#2\xint_bye{{#1}}%
+\def\POL_lcoeffs_pol P#1.{\XINT_revwbr_loop {}}%
+%
\def\xintPolCoeff#1#2%
{%
\romannumeral`&&@\expandafter\POL_coeff_fork
@@ -979,24 +984,24 @@
\def\POL_coeff_a#1{\expandafter\POL_coeff_b\romannumeral\xintgobble{#1}}%
\def\POL_coeff_b#1#2\xint:{#1}%
%
-\def\xintPolLCoeff#1%
+\def\xintPolLC#1%
{%
- \romannumeral`&&@\expandafter\POL_lcoeff_fork
+ \romannumeral`&&@\expandafter\POL_lc_fork
\romannumeral`&&@#1\xint:
}%
-\def\POL_lcoeff_fork #1%
+\def\POL_lc_fork #1%
{%
\POL_Pfork
- #1\POL_lcoeff_pol
- P\POL_lcoeff_cst
+ #1\POL_lc_pol
+ P\POL_lc_cst
\krof #1%
}%
-\def\POL_lcoeff_cst#1\xint:{#1}%
-\def\POL_lcoeff_pol P#1.%
+\def\POL_lc_cst#1\xint:{#1}%
+\def\POL_lc_pol P#1.%
{%
- \expandafter\POL_lcoeff_a\romannumeral\xintgobble{#1}%
+ \expandafter\POL_lc_a\romannumeral\xintgobble{#1}%
}%
-\def\POL_lcoeff_a#1\xint:{#1}%
+\def\POL_lc_a#1\xint:{#1}%
%
\def\xintPolMonicPart#1%
{%
@@ -1027,20 +1032,20 @@
\POL_apply:x_loop{\POL@DivByFirstAndIrrAndREZ{#1}}%
}%
%
-\def\xintPolIContent#1%
+\def\xintPolCont#1%
{%
- \romannumeral`&&@\expandafter\POL_icontent_fork
+ \romannumeral`&&@\expandafter\POL_cont_fork
\romannumeral`&&@#1^%
}%
-\def\POL_icontent_fork #1%
+\def\POL_cont_fork #1%
{%
\POL_Pfork
- #1\POL_icontent_pol
- P\POL_icontent_cst
+ #1\POL_cont_pol
+ P\POL_cont_cst
\krof #1%
}%
-\def\POL_icontent_cst #1^{\xintIrr{\xintAbs{#1}}[0]}%
-\def\POL_icontent_pol P#1.%
+\def\POL_cont_cst #1^{\xintIrr{\xintAbs{#1}}[0]}%
+\def\POL_cont_pol P#1.%
{%
% 1.4d xintfrac \XINT_fgcdof much saner than 1.4 version !
% \XINT_fgcd_out does \xintIrr
@@ -1211,7 +1216,7 @@
\def\POL_difftwo_cst#1\xint:{0/1[0]}%
\def\POL_difftwo_pol P#1.%
{%
- \ifcase #1
+ \ifcase #1 %
\or \expandafter\POL_difftwo_zeroout
\or \expandafter\POL_difftwo_cstout
\else\expandafter\POL_difftwo_polout
diff --git a/macros/generic/polexpr/polexprexpr.tex b/macros/generic/polexpr/polexprexpr.tex
index 9b60e7bab0..adb228a48b 100644
--- a/macros/generic/polexpr/polexprexpr.tex
+++ b/macros/generic/polexpr/polexprexpr.tex
@@ -1,4 +1,4 @@
-%% This file polexprexpr.tex is part of the polexpr package (0.8, 2021/03/29)
+%% This file polexprexpr.tex is part of the polexpr package (0.8.1, 2021/04/12)
%% Extending \xintexpr syntax:
%%
%% 1. Authorize ' in variable and function names
@@ -72,7 +72,7 @@
\toks0\expandafter{\XINT_expr_redefinemacros}%
\toks2 {\let\POL:NEhook:polfunc\POL:NE:polfunc}%
\edef\XINT_expr_redefinemacros{\the\toks0 \the\toks2}%
-\catcode`~ 12
+\catcode`~ 12 %
\def\POL@defpolfunc #1#2%
{%
\expandafter\POL@defpolfunc_a
@@ -137,13 +137,17 @@
}%
}%
\POL_tmp {sqr} \XINT:NEhook:f:one:from:one \xintPolSqr
+% 0.8.1 renames 0.8.0 icontent() to cont() and lcoeff() to lc()
+% and adds topol() and lcoeffs()
\POL_tmp {pol} \XINT:NEhook:f:one:from:one \xintPolPol
+\POL_tmp {lpol} \XINT:NEhook:f:one:from:one \xintPolLPol
\POL_tmp {deg} \XINT:NEhook:f:one:from:one \xintPolDeg
\POL_tmp {coeffs} \XINT:NEhook:f:one:from:one \xintPolCoeffs
+\POL_tmp {lcoeffs} \XINT:NEhook:f:one:from:one \xintPolLCoeffs
\POL_tmp {coeff} \XINT:NEhook:f:one:from:two \xintPolCoeff
-\POL_tmp {lcoeff} \XINT:NEhook:f:one:from:one \xintPolLCoeff
+\POL_tmp {lc} \XINT:NEhook:f:one:from:one \xintPolLC
\POL_tmp {monicpart} \XINT:NEhook:f:one:from:one \xintPolMonicPart
-\POL_tmp {icontent} \XINT:NEhook:f:one:from:one \xintPolIContent
+\POL_tmp {cont} \XINT:NEhook:f:one:from:one \xintPolCont
\POL_tmp {primpart} \XINT:NEhook:f:one:from:one \xintPolPrimPart
\POL_tmp {rdcoeffs} \XINT:NEhook:f:one:from:one \xintPolRedCoeffs
\POL_tmp {rdzcoeffs} \XINT:NEhook:f:one:from:one \xintPolSRedCoeffs
diff --git a/macros/generic/polexpr/polexprsturm.tex b/macros/generic/polexpr/polexprsturm.tex
index 3fa1861558..c21980830c 100644
--- a/macros/generic/polexpr/polexprsturm.tex
+++ b/macros/generic/polexpr/polexprsturm.tex
@@ -1,4 +1,4 @@
-%% This file polexprsturm.tex is part of the polexpr package (0.8, 2021/03/29)
+%% This file polexprsturm.tex is part of the polexpr package (0.8.1, 2021/04/12)
%% Sturm Algorithm (polexpr 0.4)
%% 0.5 uses primitive polynomials for faster evaluations afterwards
%% 0.6 corrects misuse of \@ifstar! (mumble). \PolToSturm* was broken.
@@ -232,7 +232,7 @@
\let\POL@findrat@nbofirrroots\POL@isolz@NbOfRoots
% find all rational roots, and their multiplicities,
% factor them out in passing from original (Sturm root) polynomial
- \ifnum\POL@findrat@E<7
+ \ifnum\POL@findrat@E<7 %
\def\POL@findrat@index{1}%
\POL@findrat@loop@secondpass@direct
\else
@@ -332,7 +332,7 @@
\edef\POL@findrat@halflocalW{\the\numexpr(\POL@findrat@localW+1)/2-1}%
% Legendre Theorem will be used now but we separate a branch where
% everything can be done with \numexpr
- \ifnum\POL@findrat@localW>9
+ \ifnum\POL@findrat@localW>9 %
% not implemented yet by lazyness!
% this root will be handled in second pass only
\else
@@ -1297,7 +1297,7 @@
\ifnum\POL@IsoRightSign=\z@
\expandafter\xintbreakiloop
\fi
- \ifnum\xintiloopindex<#1
+ \ifnum\xintiloopindex<#1 %
\repeat
}%
\def\POL@refine@main{%
@@ -1434,8 +1434,8 @@
}%
%
%% \PolPrintIntervals
-\catcode`_ 8
-\catcode`& 4
+\catcode`_ 8 %
+\catcode`& 4 %
\def\PolPrintIntervals{\POL@ifstar{\PolPrintIntervals@@}{\PolPrintIntervals@}}%
% As explained in the docs, this is an example of customization so is not
% itself customizable, apart from redefining it entirely!
@@ -1555,8 +1555,8 @@
{\PolPrintIntervalsTheVar_{\PolPrintIntervalsTheIndex}=%
\PolPrintIntervalsPrintLeftEndPoint\dots}}%
}%
-\catcode`& 7
-\catcode`_ 11
+\catcode`& 7 %
+\catcode`_ 11 %
\def\POL@PrintIntervals@Loop#1{%
\def\POL@PrintIntervals@Loop{%
\POL@SturmIfZeroExactlyKnown\PolPrintIntervalsTheSturmName
@@ -1672,12 +1672,15 @@
}%
%
\def\POL@leq@fork#1\LessThanOrEqualTo#2#3\krof{#2}%
-\def\PolSturmNbOfRootsOf#1#2#3{\romannumeral`&&@\POL@leq@fork
+\def\PolSturmNbOfRootsOf#1#2#3{%
+ \romannumeral`&&@\POL@leq@fork
#2\PolNbOfRootsLessThanOrEqualTo
- \LessThanOrEqualTo\PolNbOfRootsLessThanOrEqualToExpr\krof {#1}{#3}%
+ \LessThanOrEqualTo\PolNbOfRootsLessThanOrEqualToExpr
+ \krof {#1}{#3}%
+}%
+\def\PolNbOfRootsLessThanOrEqualToExpr#1#2{%
+ \PolNbOfRootsLessThanOrEqualTo{#1}{\xinttheexpr#2\relax}%
}%
-\def\PolNbOfRootsLessThanOrEqualToExpr#1#2
- {\PolNbOfRootsLessThanOrEqualTo{#1}{\xinttheexpr#2\relax}}%
\def\PolNbOfRootsLessThanOrEqualTo#1{%
\ifnum\PolSturmNbOfIsolatedZeros{#1}=\z@
\expandafter\xint_firstofthree\expandafter0%