From 49b02bd2f9b2cd0ef834c72850e519a9bec4ccd5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 3 Mar 2018 21:54:53 +0000 Subject: polexpr (3mar18) git-svn-id: svn://tug.org/texlive/trunk@46805 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/polexpr/README.md | 4 +- Master/texmf-dist/doc/latex/polexpr/polexpr.html | 420 +++++++++++------------ Master/texmf-dist/doc/latex/polexpr/polexpr.txt | 43 +-- 3 files changed, 232 insertions(+), 235 deletions(-) (limited to 'Master/texmf-dist/doc/latex/polexpr') diff --git a/Master/texmf-dist/doc/latex/polexpr/README.md b/Master/texmf-dist/doc/latex/polexpr/README.md index ce888d45675..e4e8fa3b38f 100644 --- a/Master/texmf-dist/doc/latex/polexpr/README.md +++ b/Master/texmf-dist/doc/latex/polexpr/README.md @@ -63,8 +63,10 @@ Releases Theorem](https://en.wikipedia.org/wiki/Sturm%27s_theorem). - 0.4.1 (2018/03/01) Synced with xint 1.3. +- 0.4.2 (2018/03/03) + Documentation fix. -Files of 0.4.1 release: +Files of 0.4.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 5a9404127bd..579a6172254 100644 --- a/Master/texmf-dist/doc/latex/polexpr/polexpr.html +++ b/Master/texmf-dist/doc/latex/polexpr/polexpr.html @@ -362,128 +362,128 @@ ul.auto-toc {

Package polexpr documentation

-

0.4.1 (2018/03/01)

+

0.4.2 (2018/03/03)

Contents

-

Basic Examples

+

Basic Examples

The syntax is:

 \poldef polname(x):= expression in variable x;
@@ -579,7 +579,7 @@ PSTricks-compatible; the letter used in output can be
 
 
-

Examples of localization of roots

+

Examples of localization of roots

First some remarks about auxiliaries.

  • To make printed decimal numbers more enjoyable than via @@ -603,7 +603,7 @@ work from command line then (I recommend rlwrap

-

A typical example

+

A typical example

In this example the polynomial is square-free; we can make sure of that by comparing the degree of the first element of the Sturm chain with the degree of the original polynomial. In such case the second element of @@ -647,7 +647,7 @@ to give the exact value for $X_2$!

-

A degree four polynomial with nearby roots

+

A degree four polynomial with nearby roots

 \PolDef{Q}{(x-1.050001)(x-1.105001)(x-1.110501)(x-1.111051)}
 \PolTypeset{Q}
@@ -670,7 +670,7 @@ to give the exact value for $X_2$!
 
-

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

 \PolDef{P}{(x-0.99)^3(x-0.999)^3(x-0.9999)^3}
 \PolTypeset{P}\par
@@ -685,7 +685,7 @@ It has \PolSturmNbOfIsolatedZeros{P} real roots.
 
-

A Mignotte type polynomial

+

A Mignotte type polynomial

 \PolDef{P}{x^10 - (10x-1)^2}%
 \PolTypeset{P}              % prints it in expanded form
@@ -708,7 +708,7 @@ $\PolSturmIsolatedZeroLeft{P}{2}<Z_2<\PolSturmIsolatedZeroRight{P}{2}$.
 
-

Roots of Chebyshev polynomials

+

Roots of Chebyshev polynomials

 \newcount\mycount
 \poldef T_0(x) := 1;
@@ -775,9 +775,9 @@ x^41
 
-

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, @@ -813,7 +813,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 @@ -821,7 +821,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 @@ -840,7 +840,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 @@ -848,12 +848,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.

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

-

\PolGet{polname}\fromarray\macro

+

\PolGet{polname}\fromarray\macro

Does the converse operation to \PolAssign{polname}\toarray\macro. No error checks on validity of coefficients as numbers. Each @@ -894,7 +894,7 @@ they were not subjected to \xintRaw or similar

-

\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, @@ -912,7 +912,7 @@ format (this may change).

-

\PolTypeset{polname}

+

\PolTypeset{polname}

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

@@ -926,7 +926,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 @@ -936,7 +936,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.

@@ -961,7 +961,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 @@ -971,7 +971,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 @@ -982,13 +982,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 @@ -998,7 +998,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 @@ -1006,7 +1006,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.

@@ -1015,32 +1015,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 @@ -1066,7 +1066,7 @@ polynomial.
no common factor among the coefficients. -->
-

\PolToSturm{polname}{sturmname}

+

\PolToSturm{polname}{sturmname}

With, for example, polname being P and sturmname being S, the macro starts by computing polynomials S_0 = P, S_1 @@ -1081,12 +1081,12 @@ roots as polynomial polname, but each with mul

-

\PolToSturm*{polname}{sturmname}

+

\PolToSturm*{polname}{sturmname}

Does not divide the Sturm chain by its last element.
-

\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 @@ -1103,7 +1103,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, @@ -1121,7 +1121,7 @@ use [\empty] as extra optional argument.

-

\PolSturmIsolateZeros{sturmname}

+

\PolSturmIsolateZeros{sturmname}

First, it evaluates using Sturm theorem the number of distinct real roots of sturmname_0.

@@ -1205,7 +1205,7 @@ are studied in numerical mathematics.

-

\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 @@ -1214,21 +1214,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 @@ -1239,7 +1239,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 @@ -1261,7 +1261,7 @@ following conditionals: \PolIfEndPointIsNegative{A}{B}, \PolIfEndPointIsZero{A}{B}.

-

\PolPrintIntervalsPrintExactZero

+

\PolPrintIntervalsPrintExactZero

This is provided to help customize how an exactly known root is printed in the right most column of the array. The package @@ -1276,7 +1276,7 @@ exactly, the macro could make a test for the value of

-

\PolPrintIntervalsPrintLeftEndPoint

+

\PolPrintIntervalsPrintLeftEndPoint

Package definition is:

@@ -1285,7 +1285,7 @@ exactly, the macro could make a test for the value of
 
-

\PolPrintIntervalsPrintRightEndPoint

+

\PolPrintIntervalsPrintRightEndPoint

Package definition is:

@@ -1295,7 +1295,7 @@ exactly, the macro could make a test for the value of
 
-

\PolMapCoeffs{\macro}{polname}

+

\PolMapCoeffs{\macro}{polname}

It modifies ('in-place': original coefficients get lost) each coefficient of the defined polynomial via the expandable macro @@ -1315,7 +1315,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 @@ -1323,7 +1323,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 @@ -1342,7 +1342,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 @@ -1352,18 +1352,18 @@ denominator.
-

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.

@@ -1379,12 +1379,12 @@ e.g. the variables as defined by -

\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 @@ -1397,7 +1397,7 @@ could be given as an expression.

-

\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 @@ -1435,7 +1435,7 @@ 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 @@ -1448,7 +1448,7 @@ could be given as an expression.

-

\PolIfCoeffIsPlusOrMinusOne{A}{B}

+

\PolIfCoeffIsPlusOrMinusOne{A}{B}

This macro is a priori undefined.

It is defined via the default \PolTypesetCmd{raw_coeff} to be @@ -1460,25 +1460,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 ?
-

\PolToExpr{polname}

+

\PolToExpr{polname}

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

@@ -1503,7 +1503,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 @@ -1516,13 +1516,13 @@ or a minus one. See \PolToE

-

\PolToExprOneTermStyleB{raw_coeff}{number}

+

\PolToExprOneTermStyleB{raw_coeff}{number}

For output in this style:

@@ -1536,7 +1536,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 @@ -1546,21 +1546,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 @@ -1570,13 +1570,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 @@ -1595,13 +1595,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}.

@@ -1624,25 +1624,25 @@ 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 (except zero polynomial which does give {0/1[0]} and not an empty output.)
-

\PolToCSV{polname}

+

\PolToCSV{polname}

Expands to coeff_0, coeff_1, coeff_2, ....., coeff_N. 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, ...

@@ -1650,7 +1650,7 @@ in the Sturm chain sturmname_0, -

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

+

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

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

@@ -1667,21 +1667,21 @@ error message (right before everything goes haywire).

-

\PolSturmIsolatedZeroLeft{sturmname}{index}

+

\PolSturmIsolatedZeroLeft{sturmname}{index}

Expands to the left end-point for the indexth interval obtained via \PolSturmIsolateZeros{sturmname} and possibly refined afterwards.
-

\PolSturmIsolatedZeroRight{sturmname}{index}

+

\PolSturmIsolatedZeroRight{sturmname}{index}

Expands to the right end-point for the indexth interval obtained via \PolSturmIsolateZeros{sturmname} and possibly refined afterwards.
-

\PolSturmNbOfIsolatedZeros{sturmname}

+

\PolSturmNbOfIsolatedZeros{sturmname}

Expands to the number of real roots of the polynomial <sturmname>_0 (which is the number of distinct real roots of the @@ -1689,17 +1689,17 @@ polynomial used to create the Sturm chain via \PolToSturm{polname}{sturmname}.
-

\PolIntervalWidth{sturmname}{index}

+

\PolIntervalWidth{sturmname}{index}

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

Macros for use within execution of \PolPrintIntervals

+

Macros for use within execution of \PolPrintIntervals

More precisely, they can be used within the replacement texts of the \PolPrintIntervalsPrintLeftEndPoint, etc, macros.

-

\PolPrintIntervalsTheEndPoint

+

\PolPrintIntervalsTheEndPoint

Within a custom \PolPrintIntervalsPrintLeftEndPoint, custom \PolPrintIntervalsPrintRightEndPoint, or custom @@ -1708,7 +1708,7 @@ or right end point of the considered interval. Serves as default replacement for \PolPrintIntervalsPrintLeftEndPoint , etc...
-

\PolIfEndPointIsZero{A}{B}

+

\PolIfEndPointIsZero{A}{B}

Within a custom \PolPrintIntervalsPrintLeftEndPoint, custom \PolPrintIntervalsPrintRightEndPoint, or custom @@ -1744,7 +1744,7 @@ the considered interval end-point is zero, else B
-

\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 @@ -1761,9 +1761,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 @@ -1776,20 +1776,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.
-

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 @@ -1797,35 +1797,32 @@ whole thing was already part of a macro argument, in such cases one can use \PolDef{f}{P(x)} rather. The colon in := may be active with no consequences.

  • -
  • During execution of polynomial operations by \poldef (but not -during the initial purely numerical parsing of the expression), the -xintfrac macro \xintAdd is temporarily patched to always express -a/b + c/d with lcm(b,d) as denominator. Indeed the current -(xint 1.2p) \xintAdd uses (ad+bc)/bd formula except if b -divides d or d divides b, which quickly leads in real life -to big denominators.

    -

    It is probable that this convention will be backported as default -behaviour of xintfrac's \xintAdd in a future xint release. When this -change is merged, there will be an impact on coefficients computed by -\poldef because the change will apply even to the pure numerical -evaluations arising during the initial stage of the parsing. Of course -the coefficients are still the same rational numbers, only -representation as fractions may change.

    -
  • -
  • As a consequence of previous rule, user-chosen common denominators -survive addition and multiplications:

    +
  • As a consequence of xintfrac addition and subtraction always using +least common multiples for the denominators [5], user-chosen common +denominators survive additions and multiplications. For example, this:

     \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;
     \poldef PQ(x):= P(x)Q(x);
     
    -

    gives the polynomial:

    +

    gives internally the polynomial:

     1/6+4/6*x^1+4/6*x^2+6/6*x^3+20/6*x^4+16/6*x^5+9/6*x^6+24/6*x^7+16/6*x^8
     
    -

    where all coefficients have the same denominator 6 (which in this -example is the least common multiple of the denominators of the -reduced coefficients.)

    +

    where all coefficients have the same denominator 6. Notice though that +\PolToExpr{PQ} outputs the 6/6*x^3 as x^3 because (by +default) it recognizes and filters out coefficients equal to one or +minus one (since release 0.3). One can use for example +\PolToCSV{PQ} to see the internally stored coefficients.

    +
+ + + + +
[5]

prior to 0.4.1, polexpr used to temporarily patch +during the parsing of polynomials the xintfrac macros. This +patch was backported to xint at release 1.3.

+
  • \PolDiff{polname_1}{polname_2} always applies \xintIrr to the resulting coefficients, except that the power of ten part [N] @@ -1860,7 +1857,7 @@ documented and unstable. Don't use them.

  • -

    CHANGE LOG

    +

    CHANGE LOG

    • v0.1 (2018/01/11): initial release. Features:

        @@ -2034,10 +2031,13 @@ for localization of the real roots of polynomials.

      • v0.4.1 (2018/03/01)

        Synced with xint 1.3.

      • +
      • v0.4.2 (2018/03/03)

        +

        Documentation fix.

        +
    -

    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 fe99d075a49..16cdff04d1e 100644 --- a/Master/texmf-dist/doc/latex/polexpr/polexpr.txt +++ b/Master/texmf-dist/doc/latex/polexpr/polexpr.txt @@ -4,7 +4,7 @@ Package polexpr documentation =============================== -0.4.1 (2018/03/01) +0.4.2 (2018/03/03) ================== .. contents:: @@ -1521,36 +1521,27 @@ Technicalities can use `\\PolDef{f}{P(x)} `_ rather. The colon in ``:=`` may be active with no consequences. -- During execution of polynomial operations by ``\poldef`` (but not - during the initial purely numerical parsing of the expression), the - xintfrac_ macro ``\xintAdd`` is temporarily patched to always express - ``a/b + c/d`` with ``lcm(b,d)`` as denominator. Indeed the current - (xint 1.2p) ``\xintAdd`` uses ``(ad+bc)/bd`` formula except if ``b`` - divides ``d`` or ``d`` divides ``b``, which quickly leads in real life - to big denominators. - - It is probable that this convention will be backported as default - behaviour of xintfrac's ``\xintAdd`` in a future xint release. When this - change is merged, there will be an impact on coefficients computed by - ``\poldef`` because the change will apply even to the pure numerical - evaluations arising during the initial stage of the parsing. Of course - the coefficients are still the same rational numbers, only - representation as fractions may change. - -- As a consequence of previous rule, user-chosen common denominators - survive addition and multiplications:: +- As a consequence of xintfrac_ addition and subtraction always using + least common multiples for the denominators [#]_, user-chosen common + denominators survive additions and multiplications. For example, this:: \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; \poldef PQ(x):= P(x)Q(x); - gives the polynomial:: + gives internally the polynomial:: 1/6+4/6*x^1+4/6*x^2+6/6*x^3+20/6*x^4+16/6*x^5+9/6*x^6+24/6*x^7+16/6*x^8 - where all coefficients have the same denominator 6 (which in this - example is the least common multiple of the denominators of the - reduced coefficients.) + where all coefficients have the same denominator 6. Notice though that + ``\PolToExpr{PQ}`` outputs the ``6/6*x^3`` as ``x^3`` because (by + default) it recognizes and filters out coefficients equal to one or + minus one (since release ``0.3``). One can use for example + ``\PolToCSV{PQ}`` to see the internally stored coefficients. + + .. [#] prior to ``0.4.1``, ``polexpr`` used to temporarily patch + during the parsing of polynomials the xintfrac_ macros. This + patch was backported to xint_ at release ``1.3``. - `\\PolDiff{polname_1}{polname_2}`_ always applies ``\xintIrr`` to the resulting coefficients, except that the *power of ten* part ``[N]`` @@ -1738,11 +1729,15 @@ CHANGE LOG The main new feature is implementation of the `Sturm algorithm`_ for localization of the real roots of polynomials. - - v0.4.1 (2018/03/01) Synced with xint 1.3. +- v0.4.2 (2018/03/03) + + Documentation fix. + + Acknowledgments --------------- -- cgit v1.2.3