Skip to contents

ratsimpmodprime(expr, G, ...) simplifies a rational function modulo the prime ideal generated by G (a Groebner basis), as SymPy's ratsimpmodprime(): it searches for a numerator and denominator of least total degree (Monagan and Pearce's algorithm). With quick = FALSE it also minimizes the number of terms, and with polynomial = TRUE it only reduces numerator and denominator modulo G.

Usage

ratsimpmodprime(expr, G, ..., quick = TRUE, polynomial = FALSE, order = "lex")

Arguments

expr

A rational expression.

G

A list of polynomials forming a Groebner basis of a prime ideal.

...

Generators.

quick

Stop at the first solution.

polynomial

Only reduce the numerator and the denominator.

order

The monomial order.

Value

An expression.

Examples

x <- Symbol("x"); y <- Symbol("y")
eq <- (x + y^5 + y) / (x - y)
# \donttest{
ratsimpmodprime(eq, list(x * y^5 - x - y), x, y, order = "lex")
#> (-x^2 - x*y - x - y)/(-x^2 + x*y)
# }