Fix series of positive powers of polynomials. Before calling pseries::power_const(), make sure the basis series has sufficient terms. In particular, do not shrink the order of expansion - only grow it. Fix various hairy problems in pseries::power_const() when a polynomial is raised to a positive integer power. (The special cases here can actually also be computed by Taylor expansion but the fixes should be more general.) Also add test cases. Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.
[DOC] Fix build of reference.pdf. This is obnoxious: It is 2023, the ≥ character is in Unicode since 1993, and UTF-8 is ubiquitous. Yet, pdfLaTeX balks at this. Maybe the right fix would be to switch to LuaLaTeX. Alas, that doesn't seem to have reached the necessary maturity yet: <https://tug.org/pipermail/luatex/2023-February/007799.html>
[PATCH] Fix wrong numeric info on transcendental functions. Although expression like cos(numeric(1, 2)) is not a symbolic, it neither is numeric in the sense of CLN library. Without this patch GiNaC crashes on expressions like cos(cos(ex(1)/ex(2))). Thanks to Weng Zhanyang <cosine@pcbcos.xyz> for reporting this.
Happy New Year!
Minor refactoring in factor.cpp. - Substitute the misnamed expt_pos(a,q) with the more specialized expt_pos_Q(w,a,q,r) function, for use by distinct_degree_factor(). - Rework canonicalize function and change semantics of its hint argument to be more natural. - Use the hint argument of canonicalize() in rem(). - Add some documenting comments.
Fix internal next_prime(n) function. This helper function was doing wild things when called the wrong way. E.g. it would allocate obscene amounts of memory and run for ages when called with an argument that has never been returned by it before. In the context where it's being used so far this is not a problem. But it's better to make it foolproof and spare a new user some possible despair and distress.
[BUGFIX] Fix corner cases of factor_multivariate(). In some rare cases, factor() failed with what looks like an endless loop trying evaluation homomorphisms with ever increasing moduli (or maybe it just took eons to complete). Whether this happened depended on which symbol was left unevaluated for univariate factorization. As a workaround for this problem, we now apply the evaluation homomorphism for each symbol in a round-robin mode until one of them succeeds. This somewhat speeds up factorization of multivariate polynomials even in those cases where the old implementation terminated in time. Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.
Refactor internal calc_bound() routines. Reduce them to computation of absolute values of the polynomial's roots and document that this is known as Landau's inequality. The multiplication with a power of two is done by the caller. Also remove the internal fallback computation using the maxcoeff since this cannot happen. (In the worst case, there is only one non-zero coefficient 'a'. Then we compute sqrt(a^2) which is not smaller than a. Otherwise, we compute sqrt(a^2 + x) > a.)