From 8128a1b13f192605f1711ea4f5f7da4550d0996a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 10 Dec 2018 22:58:44 +0000 Subject: polexpr (10dec18) git-svn-id: svn://tug.org/texlive/trunk@49378 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/polexpr/README.md | 4 +- Master/texmf-dist/doc/latex/polexpr/polexpr.html | 520 +++++++++++++---------- Master/texmf-dist/doc/latex/polexpr/polexpr.txt | 66 ++- Master/texmf-dist/tex/latex/polexpr/polexpr.sty | 135 +++--- 4 files changed, 417 insertions(+), 308 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/polexpr/README.md b/Master/texmf-dist/doc/latex/polexpr/README.md index d0275013301..fb50e104a66 100644 --- a/Master/texmf-dist/doc/latex/polexpr/README.md +++ b/Master/texmf-dist/doc/latex/polexpr/README.md @@ -75,8 +75,10 @@ Releases New feature: multiplicity of roots. - 0.7 (2018/12/08) New feature: finding all rational roots. +- 0.7.1, 0.7.2 (2018/12/09) + Emergency bugfix. -Files of 0.7 release: +Files of 0.7.2 release: - README.md, - polexpr.sty (package file), diff --git a/Master/texmf-dist/doc/latex/polexpr/polexpr.html b/Master/texmf-dist/doc/latex/polexpr/polexpr.html index 71e7ef3d019..39044a2ea54 100644 --- a/Master/texmf-dist/doc/latex/polexpr/polexpr.html +++ b/Master/texmf-dist/doc/latex/polexpr/polexpr.html @@ -362,7 +362,7 @@ ul.auto-toc {

Package polexpr documentation

-

0.7 (2018/12/08)

+

0.7.2 (2018/12/09)

@@ -376,142 +376,143 @@ ul.auto-toc {
  • A degree five polynomial with three rational roots
  • A Mignotte type polynomial
  • The Wilkinson polynomial
  • -
  • The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots
  • -
  • Roots of Chebyshev polynomials
  • +
  • The second Wilkinson polynomial
  • +
  • The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots
  • +
  • Roots of Chebyshev polynomials
  • -
  • Non-expandable macros
  • @@ -818,7 +819,7 @@ The multiplicity is 1 for the root such that 0.9997663986 < x < 0.99976639 \PolSturmIsolateZeros**{Q} \PolPrintIntervals{Q} -$Q_norr(x) = \PolTypeset{Q_norr}$ +$Q_{norr}(x) = \PolTypeset{Q_norr}$

    Here, all real roots are rational:

    @@ -849,7 +850,7 @@ Z_3 = 3.14159292035398230088...
     \PolSturmIsolateZeros{P}    % finds 4 real roots
     This polynomial has \PolSturmNbOfIsolatedZeros{P} distinct real roots:
     \PolPrintIntervals{P}%
    -% reports  -2 < Z_1 < -1, 0 < Z_2 < 0.1, 0.1 < Z_3 < 0.2, 1 < Z_4 < 2
    +% reports  -2 < Z_1 < -1, 0.09 < Z_2 < 0.10, 0.1 < Z_3 < 0.2, 1 < Z_4 < 2
     Let us refine the second and third intervals to separate the corresponding
     roots:
     \PolRefineInterval*{P}{2}% will refine to 0.0999990 < Z_2 < 0.0999991
    @@ -948,8 +949,55 @@ Z_9 = 8.9172502485...
     Z_10 = 20.8469081014...
     
    +
    +

    The second Wilkinson polynomial

    +
    +\documentclass{article}
    +\usepackage{polexpr}
    +\begin{document}
    +\poldef f(x) := mul(x - 2^-i, i = 1..20);
    +
    +%\PolTypeset{f}
    +
    +\PolToSturm{f}{f}
    +\PolSturmIsolateZeros**{f}
    +\PolPrintIntervals{f}
    +\end{document}
    +
    +

    This takes more time than the polynomial with 1, 2, .., 20 as roots but +less than the latter modified by the 2**-23 change in one +coefficient.

    +

    Here is the output (with release 0.7.2):

    +
    +Z_1  = 0.00000095367431640625
    +Z_2  = 0.0000019073486328125
    +Z_3  = 0.000003814697265625
    +Z_4  = 0.00000762939453125
    +Z_5  = 0.0000152587890625
    +Z_6  = 0.000030517578125
    +Z_7  = 0.00006103515625
    +Z_8  = 0.0001220703125
    +Z_9  = 1/4096
    +Z_10 = 1/2048
    +Z_11 = 1/1024
    +Z_12 = 1/512
    +Z_13 = 1/256
    +Z_14 = 1/128
    +Z_15 = 0.015625
    +Z_16 = 0.03125
    +Z_17 = 0.0625
    +Z_18 = 0.125
    +Z_19 = 0.25
    +Z_20 = 0.5
    +
    +

    There is some incoherence in output format which has its source in the +fact that some roots are found in branches which can only find decimal +roots, whereas some are found in branches which could find general +fractions and they use \xintIrr before storage of the found root. +This may evolve in future.

    +
    -

    The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots

    +

    The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots

     \PolDef{P}{mul((x-i*1e-1), i=-20..20)}% i/10 is same but less efficient
     
    @@ -1007,7 +1055,7 @@ optional argument keeping the same.

    -

    Roots of Chebyshev polynomials

    +

    Roots of Chebyshev polynomials

     \newcount\mycount
     \poldef T_0(x) := 1;
    @@ -1030,9 +1078,9 @@ optional argument keeping the same.

    -

    Non-expandable macros

    +

    Non-expandable macros

    -

    \poldef polname(letter):= expression in letter;

    +

    \poldef polname(letter):= expression in letter;

    This evaluates the polynomial expression and stores the coefficients in a private structure accessible later via other package macros, @@ -1069,7 +1117,7 @@ manually, if needed.

    -

    \PolDef[letter]{polname}{expression in letter}

    +

    \PolDef[letter]{polname}{expression in letter}

    Does the same as \poldef in an undelimited macro format (thus avoiding potential problems with the catcode of the @@ -1077,7 +1125,7 @@ semi-colon in presence of some packages.) In absence of the [letter] optional argument, the variable is assumed to be x.
    -

    \PolGenFloatVariant{polname}

    +

    \PolGenFloatVariant{polname}

    Makes the polynomial also usable in the \xintfloatexpr parser. It will therein evaluates via an Horner scheme with coefficients @@ -1096,7 +1144,7 @@ context.

    -

    \PolLet{polname_2}={polname_1}

    +

    \PolLet{polname_2}={polname_1}

    Makes a copy of the already defined polynomial polname_1 to a new one polname_2. Same effect as @@ -1104,12 +1152,12 @@ new one polname_2. Same effect as = is optional.
    -

    \PolAssign{polname}\toarray\macro

    +

    \PolAssign{polname}\toarray\macro

    Defines a one-argument expandable macro \macro{#1} which expands to the (raw) #1th polynomial coefficient.

    @@ -1132,7 +1180,7 @@ indices act the same in both.)

    -

    \PolGet{polname}\fromarray\macro

    +

    \PolGet{polname}\fromarray\macro

    Does the converse operation to \PolAssign{polname}\toarray\macro. Each individual @@ -1153,7 +1201,7 @@ via xintfrac

    -

    \PolFromCSV{polname}{<csv>}

    +

    \PolFromCSV{polname}{<csv>}

    Defines a polynomial directly from the comma separated list of values (or a macro expanding to such a list) of its coefficients, the first @@ -1175,7 +1223,7 @@ form via xintf

    -

    \PolTypeset{polname}

    +

    \PolTypeset{polname}

    Typesets in descending powers in math mode. It uses letter x but this can be changed via an optional argument:

    @@ -1189,7 +1237,7 @@ can be re-defined for customization. Their default definitions are expandable, but this is not a requirement.

    -

    \PolTypesetCmd{raw_coeff}

    +

    \PolTypesetCmd{raw_coeff}

    Checks if the coefficient is 1 or -1 and then skips printing the 1, except for the constant term. Also it sets conditional @@ -1199,7 +1247,7 @@ minus one is handled by -

    \PolTypesetOne{raw_coeff}

    +

    \PolTypesetOne{raw_coeff}

    The default is \xintSignedFrac but this macro is annoying as it insists to use a power of ten, and not decimal notation.

    @@ -1224,7 +1272,7 @@ which uses decimal notation (at least for the numerator part).

    -

    \PolTypesetMonomialCmd

    +

    \PolTypesetMonomialCmd

    This decides how a monomial (in variable \PolVar and with exponent \PolIndex) is to be printed. The default does nothing @@ -1234,7 +1282,7 @@ for the constant term, \PolVar for the first d \ifnum tests.
    -

    \PolTypesetCmdPrefix{raw_coeff}

    +

    \PolTypesetCmdPrefix{raw_coeff}

    Expands to a + if the raw_coeff is zero or positive, and to nothing if raw_coeff is negative, as in latter case the @@ -1245,13 +1293,13 @@ for the first term.
    -

    \PolTypeset*{polname}

    +

    \PolTypeset*{polname}

    Typesets in ascending powers. Use e.g. [h] optional argument (after the *) to use letter h rather than x.
    -

    \PolDiff{polname_1}{polname_2}

    +

    \PolDiff{polname_1}{polname_2}

    This sets polname_2 to the first derivative of polname_1. It is allowed to issue \PolDiff{f}{f}, effectively replacing f @@ -1261,7 +1309,7 @@ by f'.

    -

    \PolDiff[N]{polname_1}{polname_2}

    +

    \PolDiff[N]{polname_1}{polname_2}

    This sets polname_2 to the N-th derivative of polname_1. Identical arguments is allowed. With N=0, same effect as @@ -1269,7 +1317,7 @@ Identical arguments is allowed. With N=0, same using \PolAntiDiff.
    -

    \PolAntiDiff{polname_1}{polname_2}

    +

    \PolAntiDiff{polname_1}{polname_2}

    This sets polname_2 to the primitive of polname_1 vanishing at zero.

    @@ -1278,32 +1326,32 @@ at zero.

    -

    \PolAntiDiff[N]{polname_1}{polname_2}

    +

    \PolAntiDiff[N]{polname_1}{polname_2}

    This sets polname_2 to the result of N successive integrations on polname_1. With negative N, it switches to using \PolDiff.
    -

    \PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}

    +

    \PolDivide{polname_1}{polname_2}{polname_Q}{polname_R}

    This sets polname_Q and polname_R to be the quotient and remainder in the Euclidean division of polname_1 by polname_2.
    -

    \PolQuo{polname_1}{polname_2}{polname_Q}

    +

    \PolQuo{polname_1}{polname_2}{polname_Q}

    This sets polname_Q to be the quotient in the Euclidean division of polname_1 by polname_2.
    -

    \PolRem{polname_1}{polname_2}{polname_R}

    +

    \PolRem{polname_1}{polname_2}{polname_R}

    This sets polname_R to be the remainder in the Euclidean division of polname_1 by polname_2.
    -

    \PolGCD{polname_1}{polname_2}{polname_GCD}

    +

    \PolGCD{polname_1}{polname_2}{polname_GCD}

    This sets polname_GCD to be the (monic) GCD of the two first polynomials. It is a unitary polynomial except if both polname_1 @@ -1329,7 +1377,7 @@ polynomial.
    no common factor among the coefficients. -->
    -

    \PolToSturm{polname}{sturmname}

    +

    \PolToSturm{polname}{sturmname}

    With polname being for example P, the macro starts by computing polynomials P and P', then computes the (opposite @@ -1369,15 +1417,15 @@ i.e. it is the "square-free part" of original polynomial sturmname_k main utility is for the execution of \PolSturmIsolateZeros{sturmname}. Be careful not to use these names sturmname_0, sturmname_1, etc... for defining other -polynomials after having done \PolToSturm{polname}{sturmname} and -before executing ``\PolSturmIsolateZeros{sturmname} else the +polynomials after having done \PolToSturm{polname}{sturmname} and +before executing \PolSturmIsolateZeros{sturmname} else the latter will behave erroneously.

    \PolSturmChainLength{sturmname} gives the index of the last element of the Sturm chain.

    -

    \PolToSturm*{polname}{sturmname}

    +

    \PolToSturm*{polname}{sturmname}

    Does the same as un-starred version and additionally it keeps for user usage the memory of the un-normalized Sturm chain @@ -1401,7 +1449,7 @@ polynomials, where each f_i divides its predec

    -

    \PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}

    +

    \PolSetToSturmChainSignChangesAt{\macro}{sturmname}{fraction}

    Sets macro \macro to the number of sign changes in the Sturm chain with name prefix sturmname, at location fraction @@ -1418,7 +1466,7 @@ use [\empty] as extra optional argument.

    -

    \PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}

    +

    \PolSetToNbOfZerosWithin{\macro}{sturmname}{value_a}{value_b}

    Applies the Sturm Theorem to set \macro to the exact number of distinct roots of sturmname_0 in the interval (value_a, @@ -1447,7 +1495,7 @@ which requires prior execution of

    -

    \PolSturmIsolateZeros{sturmname}

    +

    \PolSturmIsolateZeros{sturmname}

    The macros locates, using Sturm theorem, as many disjoint intervals as there are (real) roots.

    @@ -1557,7 +1605,7 @@ are studied in numerical mathematics.

    -

    \PolSturmIsolateZeros*{sturmname}

    +

    \PolSturmIsolateZeros*{sturmname}

    The macro does the same as \PolSturmIsolateZeros{sturmname} and then in addition it does the extra work to determine all @@ -1583,7 +1631,7 @@ roots for an example.

    -

    \PolSturmIsolateZeros**{sturmname}

    +

    \PolSturmIsolateZeros**{sturmname}

    The macro does the same as \PolSturmIsolateZeros*{sturmname} and in addition it does the extra work to determine all the rational @@ -1608,17 +1656,17 @@ roots for an example.

    -

    \PolSturmIsolateZerosAndFindRationalRoots{sturmname}

    +

    \PolSturmIsolateZerosAndFindRationalRoots{sturmname}

    This works exactly like \PolSturmIsolateZeros**{sturmname} (inclusive of declaring the polynomials sturmname_sqf_norr and @@ -1648,7 +1696,7 @@ rational root anyhow).

    -

    \PolRefineInterval*{sturmname}{index}

    +

    \PolRefineInterval*{sturmname}{index}

    The index-th interval (starting indexing at one) is further subdivided as many times as is necessary in order for the newer @@ -1657,21 +1705,21 @@ the original interval. This means that the kth strictly separated from the other roots.
    -

    \PolRefineInterval[N]{sturmname}{index}

    +

    \PolRefineInterval[N]{sturmname}{index}

    The index-th interval (starting count at one) is further subdivided once, reducing its length by a factor of 10. This is done N times if the optional argument [N] is present.
    -

    \PolEnsureIntervalLength{sturmname}{index}{E}

    +

    \PolEnsureIntervalLength{sturmname}{index}{E}

    The index-th interval is subdivided until its length becomes at most 10^E. This means (for E<0) that the first -E digits after decimal mark of the kth root will then be known exactly.
    -

    \PolEnsureIntervalLengths{sturmname}{E}

    +

    \PolEnsureIntervalLengths{sturmname}{E}

    The intervals as obtained from \PolSturmIsolateZeros are (if necessary) subdivided further by (base 10) dichotomy in order for @@ -1682,7 +1730,7 @@ than 10^E in output only if it did not change

    -

    \PolPrintIntervals[varname]{sturmname}

    +

    \PolPrintIntervals[varname]{sturmname}

    This is a convenience macro which prints the bounds for the roots Z_1, Z_2, ... (the optional argument varname allows to @@ -1701,7 +1749,7 @@ modified.

    See next macros which govern its output.

    -

    \PolPrintIntervalsNoRealRoots

    +

    \PolPrintIntervalsNoRealRoots

    Executed in place of an array environment, when there are no real roots. Default definition:

    @@ -1711,7 +1759,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsBeginEnv

    +

    \PolPrintIntervalsBeginEnv

    Default definition:

    @@ -1720,7 +1768,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsEndEnv

    +

    \PolPrintIntervalsEndEnv

    Default definition:

    @@ -1729,7 +1777,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsKnownRoot

    +

    \PolPrintIntervalsKnownRoot

    Default definition:

    @@ -1741,7 +1789,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsUnknownRoot

    +

    \PolPrintIntervalsUnknownRoot

    Default definition:

    @@ -1754,7 +1802,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsPrintExactZero

    +

    \PolPrintIntervalsPrintExactZero

    Default definition:

    @@ -1763,7 +1811,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsPrintLeftEndPoint

    +

    \PolPrintIntervalsPrintLeftEndPoint

    Default definition:

    @@ -1772,7 +1820,7 @@ real roots. Default definition:

    -

    \PolPrintIntervalsPrintRightEndPoint

    +

    \PolPrintIntervalsPrintRightEndPoint

    Default definition is:

    @@ -1782,7 +1830,7 @@ real roots. Default definition:

    -

    \PolPrintIntervals*[varname]{sturmname}

    +

    \PolPrintIntervals*[varname]{sturmname}

    This starred variant produces an alternative output (which displays the root multiplicity), and is provided as an @@ -1801,7 +1849,7 @@ definition:

    Multiplicities are printed using this auxiliary macro:

    -

    \PolPrintIntervalsPrintMultiplicity

    +

    \PolPrintIntervalsPrintMultiplicity

    whose default definition is:

    @@ -1811,7 +1859,7 @@ definition:

    -

    \PolMapCoeffs{\macro}{polname}

    +

    \PolMapCoeffs{\macro}{polname}

    It modifies ('in-place': original coefficients get lost) each coefficient of the defined polynomial via the expandable macro @@ -1831,7 +1879,7 @@ will have to be expressed in terms of macros from

    -

    \PolReduceCoeffs{polname}

    +

    \PolReduceCoeffs{polname}

    About the same as \PolMapCoeffs{\xintIrr}{polname} (but maintaining a [0] postfix for speedier xintfrac parsing when @@ -1839,7 +1887,7 @@ polynomial function is used for computations.) This is a one-argument macro, working 'in-place'.
    -

    \PolReduceCoeffs*{polname}

    +

    \PolReduceCoeffs*{polname}

    This starred variant leaves un-touched the decimal exponent in the internal representation of the fractional coefficients, i.e. if a @@ -1858,7 +1906,7 @@ expansion speed of the -

    \PolMakeMonic{polname}

    +

    \PolMakeMonic{polname}

    Divides by the leading coefficient. It is recommended to execute \PolReduceCoeffs*{polname} immediately afterwards. This is not @@ -1867,7 +1915,7 @@ coefficients and we want to keep the leading one as common denominator.
    -

    \PolMakePrimitive{polname}

    +

    \PolMakePrimitive{polname}

    Divides by the integer content see (\PolIContent). This thus produces a polynomial with integer coefficients having no common factor. The sign of the leading @@ -1875,36 +1923,36 @@ coefficient is not modified.
    -

    Expandable macros

    +

    Expandable macros

    All these macros expand completely in two steps except \PolToExpr and \PolToFloatExpr (and their auxiliaries) which need a \write, \edef or a \csname...\endcsname context.

    -

    \PolEval{polname}\AtExpr{numerical expression}

    +

    \PolEval{polname}\AtExpr{numerical expression}

    It boils down to \xinttheexpr polname(numerical expression)\relax.
    -

    \PolEval{polname}\At{fraction}

    +

    \PolEval{polname}\At{fraction}

    Evaluates the polynomial at value fraction which must be in (or expand to) a format acceptable to the xintfrac macros.
    -

    \PolEvalReduced{polname}\AtExpr{numerical expression}

    +

    \PolEvalReduced{polname}\AtExpr{numerical expression}

    Boils down to \xinttheexpr reduce(polname(numerical expression))\relax.
    -

    \PolEvalReduced{polname}\At{fraction}

    +

    \PolEvalReduced{polname}\At{fraction}

    Evaluates the polynomial at value fraction which must be in (or expand to) a format acceptable to the xintfrac macros, and produce an irreducible fraction.
    -

    \PolFloatEval{polname}\AtExpr{numerical expression}

    +

    \PolFloatEval{polname}\AtExpr{numerical expression}

    Boils down to \xintthefloatexpr polname(numerical expression)\relax.

    This is done via a Horner Scheme (see \poldef and @@ -1936,14 +1984,14 @@ nested expressions.

    -

    \PolFloatEval{polname}\At{fraction}

    +

    \PolFloatEval{polname}\At{fraction}

    Evaluates the polynomial at value fraction which must be in (or expand to) a format acceptable to the xintfrac macros, and produces a floating point number.
    -

    \PolIfCoeffIsPlusOrMinusOne{A}{B}

    +

    \PolIfCoeffIsPlusOrMinusOne{A}{B}

    This macro is a priori undefined.

    It is defined via the default \PolTypesetCmd{raw_coeff} to be @@ -1955,25 +2003,25 @@ plus or minus one, and B if not.

    -

    \PolLeadingCoeff{polname}

    +

    \PolLeadingCoeff{polname}

    Expands to the leading coefficient.
    -

    \PolNthCoeff{polname}{number}

    +

    \PolNthCoeff{polname}{number}

    It expands to the raw N-th coefficient (0/1[0] if the index number is out of range). With N=-1, -2, ... expands to the leading coefficients.
    -

    \PolDegree{polname}

    +

    \PolDegree{polname}

    It expands to the degree. This is -1 if zero polynomial but this may change in future. Should it then expand to -\infty ?
    -

    \PolIContent{polname}

    +

    \PolIContent{polname}

    It expands to the contents of the polynomial, i.e. to the positive fraction such that dividing by this fraction produces a polynomial @@ -1982,7 +2030,7 @@ with integer coefficients having no common prime divisor.

    -

    \PolToExpr{polname}

    +

    \PolToExpr{polname}

    Expands [4] to coeff_N*x^N+... (descending powers.)

    @@ -2007,7 +2055,7 @@ of \PolToExpr{f}, but a simple -

    \PolToExprOneTerm{raw_coeff}{number}

    +

    \PolToExprOneTerm{raw_coeff}{number}

    This two argument expandable command takes care of the monomial and its coefficient. The default definition is done in order for @@ -2020,13 +2068,13 @@ or a minus one. See \PolToE

    -

    \PolToExprOneTermStyleB{raw_coeff}{number}

    +

    \PolToExprOneTermStyleB{raw_coeff}{number}

    For output in this style:

    @@ -2040,7 +2088,7 @@ To revert to package default, issue
     
    -

    \PolToExprCmd{raw_coeff}

    +

    \PolToExprCmd{raw_coeff}

    It is the one-argument macro used by the package definition of \PolToExprOneTerm for the coefficients themselves (when not @@ -2050,21 +2098,21 @@ to \xintIrr{#1} or to output forcefully reduced coefficients.
    -

    \PolToExprTermPrefix{raw_coeff}

    +

    \PolToExprTermPrefix{raw_coeff}

    Defined identically as \PolTypesetCmdPrefix{raw_coeff}. It prefixes with a plus sign for non-negative coefficients, because they don't carry one by themselves.
    -

    \PolToExprVar

    +

    \PolToExprVar

    This expands to the variable to use in output (it does not have to be a single letter, may be an expandable macro.) Initial definition is x.
    -

    \PolToExprTimes

    +

    \PolToExprTimes

    This expands to the symbol used for multiplication of an x^{number} by the corresponding coefficient. The default is @@ -2074,13 +2122,13 @@ algebra software).
    -

    \PolToExpr*{polname}

    +

    \PolToExpr*{polname}

    Expands to coeff_0+coeff_1*x+coeff_2*x^2+... (ascending powers). Customizable like \PolToExpr{polname} via the same macros.
    -

    \PolToFloatExpr{polname}

    +

    \PolToFloatExpr{polname}

    Similar to \PolToExpr{polname} but uses \PolToFloatExprCmd which by default rounds and converts the coefficients to floating @@ -2099,13 +2147,13 @@ those output by \PolToFloatExpr{polname}.

    -

    \PolToFloatExprOneTerm{raw_coeff}{number}

    +

    \PolToFloatExprOneTerm{raw_coeff}{number}

    Similar to \PolToExprOneTerm. But does not treat especially coefficients equal to plus or minus one.
    -

    \PolToFloatExprCmd{raw_coeff}

    +

    \PolToFloatExprCmd{raw_coeff}

    It is the one-argument macro used by \PolToFloatExprOneTerm. Its package definition is \xintFloat{#1}.

    @@ -2128,12 +2176,12 @@ in xintfrac raw format.

    -

    \PolToFloatExpr*{polname}

    +

    \PolToFloatExpr*{polname}

    Typesets in ascending powers.
    -

    \PolToList{polname}

    +

    \PolToList{polname}

    Expands to {coeff_0}{coeff_1}...{coeff_N} with N = degree, and coeff_N the leading coefficient @@ -2141,14 +2189,14 @@ Expands to {coeff_0}{coeff_1}...{ empty output.)
    -

    \PolToCSV{polname}

    +

    \PolToCSV{polname}

    Expands to coeff_0, coeff_1, coeff_2, ....., coeff_N, starting with constant term and ending with leading coefficient. Converse to \PolFromCSV.
    -

    \PolSturmChainLength{sturmname}

    +

    \PolSturmChainLength{sturmname}

    Returns the integer N such that sturmname_N is the last one in the Sturm chain sturmname_0, sturmname_1, ...

    @@ -2156,7 +2204,7 @@ in the Sturm chain sturmname_0, -

    \PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}

    +

    \PolSturmIfZeroExactlyKnown{sturmname}{index}{A}{B}

    Executes A if the index-th interval reduces to a singleton, i.e. the root is known exactly, else B.

    @@ -2168,7 +2216,7 @@ to \the\numexpr...\relax
    -

    \PolSturmIsolatedZeroLeft{sturmname}{index}

    +

    \PolSturmIsolatedZeroLeft{sturmname}{index}

    Expands to the left end-point for the index-th interval, as computed by some earlier \PolSturmIsolateZeros{sturmname}.

    @@ -2181,7 +2229,7 @@ computed by some earlier -

    \PolSturmIsolatedZeroRight{sturmname}{index}

    +

    \PolSturmIsolatedZeroRight{sturmname}{index}

    Expands to the right end-point for the index-th interval as computed by some earlier \PolSturmIsolateZeros{sturmname} and @@ -2190,7 +2238,7 @@ possibly refined afterwards.

    -

    \PolSturmIsolatedZeroMultiplicity{sturmname}{index}

    +

    \PolSturmIsolatedZeroMultiplicity{sturmname}{index}

    Expands to the multiplicity of the unique root contained in the index-th interval.

    @@ -2203,7 +2251,7 @@ roots for an example of use.

    -

    \PolSturmNbOfIsolatedZeros{sturmname}

    +

    \PolSturmNbOfIsolatedZeros{sturmname}

    Expands to the number of real roots of the polynomial <sturmname>_0, i.e. the number of distinct real roots of the @@ -2218,7 +2266,7 @@ enough. They can be re-coded at user level on the basis of the other documented package macros anyway.

    -

    \PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}

    +

    \PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualTo{value}

    Expands to the number of distinct roots (of the polynomial used to create the Sturm chain) less than or equal to the value (i.e. a @@ -2234,7 +2282,7 @@ of the above constraint.

    -

    \PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}

    +

    \PolSturmNbOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}

    Expands to the number of distinct roots (of the polynomial used to create the Sturm chain) which are less than or equal to the @@ -2247,7 +2295,7 @@ beforehand.

    -

    \PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}

    +

    \PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualTo{value}

    Expands to the number counted with multiplicities of the roots (of the polynomial used to create the Sturm chain) which are less than @@ -2260,7 +2308,7 @@ variant) must have been executed beforehand.

    -

    \PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}

    +

    \PolSturmNbWithMultOfRootsOf{sturmname}\LessThanOrEqualToExpr{expression}

    Expands to the total number of roots (counted with multiplicities) which are less than or equal to the given expression.

    @@ -2273,7 +2321,7 @@ variant) must have been executed beforehand.

    -

    \PolSturmNbOfRationalRoots{sturmname}

    +

    \PolSturmNbOfRationalRoots{sturmname}

    Expands to the number of rational roots (without multiplicities).

    @@ -2284,7 +2332,7 @@ beforehand.

    -

    \PolSturmNbOfRationalRootsWithMultiplicities{sturmname}

    +

    \PolSturmNbOfRationalRootsWithMultiplicities{sturmname}

    Expands to the number of rational roots (counted with multiplicities).

    @@ -2295,7 +2343,7 @@ beforehand.

    -

    \PolSturmRationalRoot{sturmname}{k}

    +

    \PolSturmRationalRoot{sturmname}{k}

    Expands to the kth rational root (they are ordered and indexed starting at 1 for the most negative).

    @@ -2307,7 +2355,7 @@ beforehand.

    -

    \PolSturmRationalRootIndex{sturmname}{k}

    +

    \PolSturmRationalRootIndex{sturmname}{k}

    Expands to index of the kth rational root as part of the ordered real roots (without multiplicities). I.e., above macro @@ -2324,7 +2372,7 @@ beforehand.

    -

    \PolSturmRationalRootMultiplicity{sturmname}{k}

    +

    \PolSturmRationalRootMultiplicity{sturmname}{k}

    Expands to the multiplicity of the kth rational root.

    @@ -2335,13 +2383,13 @@ beforehand.

    -

    \PolIntervalWidth{sturmname}{index}

    +

    \PolIntervalWidth{sturmname}{index}

    The 10^E width of the current index-th root localization interval. Output is in xintfrac raw 1/1[E] format (if not zero).
    -

    Expandable macros for use within execution of \PolPrintIntervals

    +

    Expandable macros for use within execution of \PolPrintIntervals

    These macros are for usage within custom user redefinitions of \PolPrintIntervalsKnownRoot, \PolPrintIntervalsUnknownRoot, or in redefinitions of PolPrintIntervalsPrintExactZero (used in the @@ -2357,26 +2405,26 @@ latter).

    \PolIfEndPointIsZero{A}{B}.

    -

    \PolPrintIntervalsTheVar

    +

    \PolPrintIntervalsTheVar

    Expands to the name (default Z) used for representing the roots, which was passed as optional argument varname to \PolPrintIntervals[varname]{sturmname}.
    -

    \PolPrintIntervalsTheIndex

    +

    \PolPrintIntervalsTheIndex

    Expands to the index of the considered interval (indexing starting at 1 for the leftmost interval).
    -

    \PolPrintIntervalsTheLeftEndPoint

    +

    \PolPrintIntervalsTheLeftEndPoint

    The left end point of the interval, as would be produced by \PolSturmIsolatedZeroLeft if it was @@ -2385,14 +2433,14 @@ by \PolPrint \PolPrintIntervalsTheIndex.
    -

    \PolPrintIntervalsTheRightEndPoint

    +

    \PolPrintIntervalsTheRightEndPoint

    The right end point of the interval, as would be produced by \PolSturmIsolatedZeroRight for this Sturm chain name and index.
    -

    \PolPrintIntervalsTheMultiplicity

    +

    \PolPrintIntervalsTheMultiplicity

    The multiplicity of the unique root within the interval of index \PolPrintIntervalsTheIndex. Makes sense only if the starred (or @@ -2400,7 +2448,7 @@ double-starred) variant of -

    \PolDecToString{decimal number}

    +

    \PolDecToString{decimal number}

    This is a utility macro to print decimal numbers. It has been backported to xintfrac (release 1.3 of 2018/03/01) under @@ -2417,9 +2465,9 @@ zeroes, one can use \PolDecToStri

    -

    Booleans (with default setting as indicated)

    +

    Booleans (with default setting as indicated)

    -

    \xintverbosefalse

    +

    \xintverbosefalse

    This is actually an xintexpr configuration. Setting it to true triggers the writing of information to the log when new @@ -2432,20 +2480,20 @@ unstable and undocumented internal structures.

    -

    \poltypesetallfalse

    +

    \poltypesetallfalse

    If true, \PolTypeset{polname} will also typeset the vanishing coefficients.
    -

    \poltoexprallfalse

    +

    \poltoexprallfalse

    If true, \PolToExpr{polname} and \PolToFloatExpr{polname} will also include the vanishing coefficients in their outputs.
    -

    \polexprsetup

    +

    \polexprsetup

    Serves to customize the package. Currently only two keys are recognized:

    @@ -2466,7 +2514,7 @@ sqfnorr=_sqf_norr}
    as default.

    -

    Technicalities

    +

    Technicalities

    • The catcode of the semi-colon is reset temporarily by \poldef macro in case some other package (for example the French babel module) may have made it active. This will fail though if the @@ -2523,7 +2571,7 @@ documented and unstable. Don't use them.

    -

    CHANGE LOG

    +

    CHANGE LOG

    -

    Acknowledgments

    +

    Acknowledgments

    Thanks to Jürgen Gilg whose question about xint 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/Master/texmf-dist/doc/latex/polexpr/polexpr.txt b/Master/texmf-dist/doc/latex/polexpr/polexpr.txt index 51008763dcf..d77361edc4a 100644 --- a/Master/texmf-dist/doc/latex/polexpr/polexpr.txt +++ b/Master/texmf-dist/doc/latex/polexpr/polexpr.txt @@ -4,8 +4,8 @@ Package polexpr documentation =============================== -0.7 (2018/12/08) -================ +0.7.2 (2018/12/09) +================== .. contents:: @@ -334,7 +334,7 @@ A degree five polynomial with three rational roots \PolSturmIsolateZeros**{Q} \PolPrintIntervals{Q} - $Q_norr(x) = \PolTypeset{Q_norr}$ + $Q_{norr}(x) = \PolTypeset{Q_norr}$ Here, all real roots are rational:: @@ -367,7 +367,7 @@ A Mignotte type polynomial \PolSturmIsolateZeros{P} % finds 4 real roots This polynomial has \PolSturmNbOfIsolatedZeros{P} distinct real roots: \PolPrintIntervals{P}% - % reports -2 < Z_1 < -1, 0 < Z_2 < 0.1, 0.1 < Z_3 < 0.2, 1 < Z_4 < 2 + % reports -2 < Z_1 < -1, 0.09 < Z_2 < 0.10, 0.1 < Z_3 < 0.2, 1 < Z_4 < 2 Let us refine the second and third intervals to separate the corresponding roots: \PolRefineInterval*{P}{2}% will refine to 0.0999990 < Z_2 < 0.0999991 @@ -470,6 +470,56 @@ decimal digits is relatively faster. Here is for the ten real roots of Z_9 = 8.9172502485... Z_10 = 20.8469081014... +The second Wilkinson polynomial +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:: + + \documentclass{article} + \usepackage{polexpr} + \begin{document} + \poldef f(x) := mul(x - 2^-i, i = 1..20); + + %\PolTypeset{f} + + \PolToSturm{f}{f} + \PolSturmIsolateZeros**{f} + \PolPrintIntervals{f} + \end{document} + +This takes more time than the polynomial with 1, 2, .., 20 as roots but +less than the latter modified by the ``2**-23`` change in one +coefficient. + +Here is the output (with release 0.7.2):: + + Z_1 = 0.00000095367431640625 + Z_2 = 0.0000019073486328125 + Z_3 = 0.000003814697265625 + Z_4 = 0.00000762939453125 + Z_5 = 0.0000152587890625 + Z_6 = 0.000030517578125 + Z_7 = 0.00006103515625 + Z_8 = 0.0001220703125 + Z_9 = 1/4096 + Z_10 = 1/2048 + Z_11 = 1/1024 + Z_12 = 1/512 + Z_13 = 1/256 + Z_14 = 1/128 + Z_15 = 0.015625 + Z_16 = 0.03125 + Z_17 = 0.0625 + Z_18 = 0.125 + Z_19 = 0.25 + Z_20 = 0.5 + +There is some incoherence in output format which has its source in the +fact that some roots are found in branches which can only find decimal +roots, whereas some are found in branches which could find general +fractions and they use ``\xintIrr`` before storage of the found root. +This may evolve in future. + The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -961,7 +1011,7 @@ Non-expandable macros The polynomials ``sturmname_k`` main utility is for the execution of `\\PolSturmIsolateZeros{sturmname}`_. Be careful not to use these names ``sturmname_0``, ``sturmname_1``, etc... for defining other - polynomials after having done ``\PolToSturm{polname}{sturmname} and + polynomials after having done ``\PolToSturm{polname}{sturmname}`` and before executing ``\PolSturmIsolateZeros{sturmname}`` else the latter will behave erroneously. @@ -2448,7 +2498,11 @@ CHANGE LOG - `\\PolSturmNbWithMultOfRootsOf{sturmname}\\LessThanOrEqualTo{value}`_ - `\\PolSturmNbWithMultOfRootsOf{sturmname}\\LessThanOrEqualToExpr{expression}`_ -- v0.7 (2018/12/08) +- v0.7 (2018/12/08) (not released) + +- v0.7.1 (2018/12/09) (bugfix) + +- v0.7.2 (2018/12/09) * breaking changes: diff --git a/Master/texmf-dist/tex/latex/polexpr/polexpr.sty b/Master/texmf-dist/tex/latex/polexpr/polexpr.sty index 601446cf671..9bc286115d8 100644 --- a/Master/texmf-dist/tex/latex/polexpr/polexpr.sty +++ b/Master/texmf-dist/tex/latex/polexpr/polexpr.sty @@ -1,7 +1,7 @@ % author: Jean-François Burnol % License: LPPL 1.3c (author-maintained) \ProvidesPackage{polexpr}% - [2018/12/08 v0.7 Polynomial expressions with rational coefficients (JFB)]% + [2018/12/09 v0.7.2 Polynomial expressions with rational coefficients (JFB)]% \RequirePackage{xintexpr}[2018/06/17]% xint 1.3c for \ifxintglobaldefs boolean \edef\POL@restorecatcodes {\catcode`\noexpand\_ \the\catcode`\_ % @@ -914,12 +914,13 @@ {\let\POL@findrat@E\POL@findrat@Dexp} % aussi ok pour 1[0] {\edef\POL@findrat@E{\the\numexpr\xintLen{\POL@findrat@Dint}% +\POL@findrat@Dexp}}% +% ATTENTION QUE LA CONVENTION DE SIGNE POUR \POL@findrat@E EST OPPOSÉE À CELLE +% POUR LE CODE PLUS ANCIEN FAISANT "REFINE" \POL@initarray\POL@IfMultIsKnown\xint_secondoftwo \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 - \PolEnsureIntervalLength{\POL@sturmname}{1}{-\POL@findrat@E}% \def\POL@findrat@index{1}% \POL@findrat@loop@secondpass@direct \else @@ -928,7 +929,6 @@ \POL@findrat@loop@firstpass % and now we do the final pass finding them all \def\POL@findrat@index{1}% - \PolEnsureIntervalLength{\POL@sturmname}{1}{-\POL@findrat@E}% \POL@findrat@loop@secondpass \fi % declare the new polynomials @@ -947,7 +947,7 @@ {}% \ifnum\xintiloopindex<\POL@isolz@NbOfRoots\space \repeat }% - \begingroup\globaldefs1 + \begingroup\globaldefs\@ne % attention de ne surtout pas faire un \expandafter ici, car en cas d'un % seul item, \xintAssignArray l'unbraces... \xintAssignArray\POL@temp\to#1% @@ -956,36 +956,20 @@ \def\POL@findrat@loop@firstpass{% \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% \POL@findrat@loop@decimal% get its multiplicity - \POL@findrat@loop@a + \POL@findrat@loop@aa % refine interval and check \edef\POL@findrat@index{\the\numexpr\POL@findrat@index+\@ne}% \ifnum\POL@findrat@index>\POL@isolz@NbOfRoots \else \expandafter\POL@findrat@loop@firstpass \fi }% -\def\POL@findrat@loop@secondpass{% +\def\POL@findrat@loop@aa{% + % we do a first pass to identify roots with denominators < 1000 + \PolEnsureIntervalLength{\POL@sturmname}{\POL@findrat@index}{-6}% + % attention that perhaps now the root is known! \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% - {}% nothing more to be done, already stored - \POL@findrat@loop@b - \edef\POL@findrat@index{\the\numexpr\POL@findrat@index+\@ne}% - \ifnum\POL@findrat@index>\POL@isolz@NbOfRoots - \else - \PolEnsureIntervalLength - {\POL@sturmname}{\POL@findrat@index}{-\POL@findrat@E}% dynamic - \expandafter\POL@findrat@loop@secondpass - \fi -}% -\def\POL@findrat@loop@secondpass@direct{% - \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% - \POL@findrat@loop@decimal - \POL@findrat@loop@b - \edef\POL@findrat@index{\the\numexpr\POL@findrat@index+\@ne}% - \ifnum\POL@findrat@index>\POL@isolz@NbOfRoots - \else - \PolEnsureIntervalLength - {\POL@sturmname}{\POL@findrat@index}{-\POL@findrat@E}% dynamic - \expandafter\POL@findrat@loop@secondpass@direct - \fi + \POL@findrat@loop@decimal + \POL@findrat@loop@a }% \def\POL@findrat@loop@decimal{% we have an already found decimal root % we do not go via @storeit, as it is already stored @@ -1002,6 +986,7 @@ \edef\POLuserpol@_findrat@oneterm{1.\noexpand\empty {\xintiiOpp\POL@findrat@xN/1[0]}{\POL@findrat@xD/1[0]}}% \POL@divide{\POL@sturmname\POL@sqfnorr}{_findrat@oneterm}% the one without mult. + %\expandafter\POL@split\POL@R;\POL@degR\POL@polR \POL@findrat@loop@updatequotients \POL@findrat@loop@getmultiplicity }% @@ -1018,10 +1003,7 @@ \def\POL@findrat@getE #1/1[#2]{#2}% /1 as it should be there. % so an error will arise if not but cf \POL@refine@getE where I did not put it \def\POL@findrat@loop@a{% - % we do a first pass to identify roots with denominators < 1000 - \PolEnsureIntervalLength{\POL@sturmname}{\POL@findrat@index}{-6}% % attention that the width may have been already smaller than 10^{-6} - % also attention that one of the bound may be zero \POL@get@IsoLeft@rawin \POL@get@IsoRight@rawin \edef\POL@findrat@localW @@ -1046,28 +1028,20 @@ \fi }% \def\POL@findrat@gcdloop{% - % we must be careful with sign (attention one of the bounds may be zero) - \let\POL@findrat@IfNeg\xint_secondoftwo + % we must be careful with sign + % but we are certain no extremity is a root + \let\POL@findrat@ifnegative\xint_secondoftwo \xintiiifSgn\POL@IsoLeft@Int \POL@findrat@gcdloop@n - \POL@findrat@gcdloop@zero + \POL@error@thisisimpossible \POL@findrat@gcdloop@p }% \def\POL@findrat@gcdloop@n{% - \let\POL@findrat@IfNeg\xint_firstoftwo + \let\POL@findrat@ifnegative\xint_firstoftwo \let\POL@temp\POL@IsoRight@Int \edef\POL@IsoRight@Int{\xintiiOpp{\POL@IsoLeft@Int}}% \edef\POL@IsoLeft@Int{\xintiiOpp{\POL@temp}}% - \xintiiifSgn\POL@IsoLeft@Int - \POL@error % impossible branch - \POL@findrat@gcdloop@zero - \POL@findrat@gcdloop@p -}% -\def\POL@findrat@gcdloop@zero{% - % the continued fraction would be the one of 1/2, so only 1/2 to test... - \edef\POL@findrat@x - {1/2\romannumeral\xintreplicate{\POL@findrat@localW}{0}[0]}% - \POL@findrat@gcdloop@testit + \POL@findrat@gcdloop@p }% \def\POL@findrat@gcdloop@p{% \edef\POL@findrat@gcdloop@Ap{\xintDec{\xintDouble\POL@IsoRight@Int}}% @@ -1140,7 +1114,7 @@ }% \def\POL@findrat@gcdloop@testit{% % zero should never occur here - \POL@findrat@IfNeg{\edef\POL@findrat@x{-\POL@findrat@x}}{}% + \POL@findrat@ifnegative{\edef\POL@findrat@x{-\POL@findrat@x}}{}% \POL@xintfrac@getNDE\POL@findrat@x\POL@findrat@xN\POL@findrat@xD\POL@_ \edef\POLuserpol@_findrat@oneterm{1.\noexpand\empty {\xintiiOpp{\POL@findrat@xN}/1[0]}{\POL@findrat@xD/1[0]}}% @@ -1151,10 +1125,36 @@ \POL@findrat@loop@updatequotients \POL@findrat@loop@getmultiplicity % will continue updating the mult. one \def\POL@findrat@gcdloop@done{1}% - \else \fi }% % This is second phase +\def\POL@findrat@loop@secondpass{% + \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% + {}% nothing more to be done, already stored + \POL@findrat@loop@bb % refine interval and check + \edef\POL@findrat@index{\the\numexpr\POL@findrat@index+\@ne}% + \ifnum\POL@findrat@index>\POL@isolz@NbOfRoots + \else + \expandafter\POL@findrat@loop@secondpass + \fi +}% +\def\POL@findrat@loop@secondpass@direct{% + \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% + \POL@findrat@loop@decimal + \POL@findrat@loop@bb + \edef\POL@findrat@index{\the\numexpr\POL@findrat@index+\@ne}% + \ifnum\POL@findrat@index>\POL@isolz@NbOfRoots + \else + \expandafter\POL@findrat@loop@secondpass@direct + \fi +}% +\def\POL@findrat@loop@bb{% + \PolEnsureIntervalLength{\POL@sturmname}{\POL@findrat@index}{-\POL@findrat@E}% + % ATTENTION THAT PERHAPS NOW THE ROOT IS KNOWN! + \PolSturmIfZeroExactlyKnown{\POL@sturmname}{\POL@findrat@index}% + \POL@findrat@loop@decimal + \POL@findrat@loop@b +}% \def\POL@findrat@loop@b{% \edef\POL@findrat@Lscaled{\xintMul{\POL@findrat@D}% {\POL@xintexprGetVar{\POL@sturmname L_\POL@findrat@index}}}% @@ -1206,11 +1206,13 @@ \let\csname POL_ZeroIsKnown\POL@sturmname\POL@findrat@index\endcsname \xint_stop_atfirstoftwo \begingroup\xintglobaldefstrue - \xintdefvar - \POL@sturmname L_\POL@findrat@index,% - \POL@sturmname R_\POL@findrat@index,% - \POL@sturmname Z_\POL@findrat@index _isknown - := qfrac(\POL@findrat@x),qfrac(\POL@findrat@x),1;% + % skip some overhead of \xintdefvar... + \XINT_expr_defvar_one{\POL@sturmname L_\POL@findrat@index}% + {\csname .=\POL@findrat@x\endcsname}% + \XINT_expr_defvar_one{\POL@sturmname R_\POL@findrat@index}% + {\csname .=\POL@findrat@x\endcsname}% + \XINT_expr_defvar_one{\POL@sturmname Z_\POL@findrat@index _isknown}% + {\csname .=1\endcsname}% \endgroup }% \def\POL@findrat@loop@updatequotients{% @@ -1320,8 +1322,9 @@ % added at 0.7 \let\x\POL@isolz@NbOfRoots \xintloop - \xintdefvar \POL@sturmname M_\x - := \csname POL_ZeroMult\POL@sturmname\x\endcsname ;% + % skip some overhead of \xintdefvar... + \XINT_expr_defvar_one{\POL@sturmname M_\x}% + {\csname .=\csname POL_ZeroMult\POL@sturmname\x\endcsname\endcsname}% \edef\x{\the\numexpr\x-\@ne}% \ifnum\x>\z@ \repeat @@ -1694,11 +1697,11 @@ \repeat }% \def\POL@isolz@check{% \POL@IsoRightSign must be ready for use here -% \ifxintverbose -% \xintMessage{polexpr}{Info}% -% {\the\numexpr\POL@IsoLeftSV-\POL@IsoRightSV\relax\space roots -% in (\POL@IsoLeft@raw,\POL@IsoRight@raw] (E = \POL@isolz@E)}% -% \fi +\ifxintverbose + \xintMessage{polexpr}{Info}% + {\the\numexpr\POL@IsoLeftSV-\POL@IsoRightSV\relax\space roots + in (\POL@IsoLeft@raw,\POL@IsoRight@raw] (E = \POL@isolz@E)}% +\fi \ifcase\numexpr\POL@IsoLeftSV-\POL@IsoRightSV\relax % no root in ]left, right] \global\POL@isolz@nextwillneedrefinefalse @@ -1896,18 +1899,16 @@ \xint_stop_atfirstoftwo \fi \begingroup\xintglobaldefstrue - \xintdefvar - \POL@sturmname L_\POL@isolz@IntervalIndex,% - \POL@sturmname R_\POL@isolz@IntervalIndex,% + % skip some overhead of \xintdefvar... + \XINT_expr_defvar_one{\POL@sturmname L_\POL@isolz@IntervalIndex}% + {\csname .=\POL@IsoLeft@rawout\endcsname}% + \XINT_expr_defvar_one{\POL@sturmname R_\POL@isolz@IntervalIndex}% + {\csname .=\POL@IsoRight@rawout\endcsname}% % added at 0.7 - \POL@sturmname Z_\POL@isolz@IntervalIndex _isknown - := qfrac(\POL@IsoLeft@rawout),% - qfrac(\POL@IsoRight@rawout),% - \ifnum\POL@IsoRightSign=\z@ 1\else 0\fi;% + \XINT_expr_defvar_one{\POL@sturmname Z_\POL@isolz@IntervalIndex _isknown}% + {\csname .=\ifnum\POL@IsoRightSign=\z@ 1\else 0\fi\endcsname}% \endgroup }% - - %% \PolRefineInterval \def\POL@xintexprGetVar#1{\expandafter\expandafter\expandafter \XINT_expr_unlock\csname XINT_expr_var_#1\endcsname}% -- cgit v1.2.3