Skip to content

Fix modular reduction during PolyRatFun expansion - #921

Open
cbmarini wants to merge 1 commit into
form-dev:masterfrom
cbmarini:polyfun-modulus
Open

cbmarini wants to merge 1 commit into
form-dev:masterfrom
cbmarini:polyfun-modulus

Conversation

@cbmarini

Copy link
Copy Markdown
Collaborator

PolyRatFun expansion does not consistently reduce coefficients after its arguments have been reduced modulo the active modulus. For example:

Modulus 13;
CFunction rat;
Symbol ep;
PolyRatFun rat(expand,ep,2);

Local F = rat(1,1+ep/2);
Print +s;
.end

This produces rat(1 - 7*ep + 49*ep^2) instead of rat(1 + 6*ep + 10*ep^2).

This PR adds the modular reduction to ExpandRat(), InvPoly() and MultiplyWithTerm(), which perform the PolyRatFun expansion. Furthermore, also related PolyFun and dollar factorization paths are fixed. Regression tests and the manual are updated.

now properly modulo reduced if Modulus is active.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 66.128% — cbmarini:polyfun-modulus into form-dev:master. No base build found for form-dev:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants