polylib::makerat
-- convert
expression into rational function over a suitable fieldpolylib::makerat
(a)
returns two
polynomials f and g over some extension field of
the rationals and a list of substitutions such that applying the
substitutions to the rational function (f)/(g) gives
a
.
polylib::makerat
(l)
does the same for
every element of a list l
of expressions such that the
same extension field is chosen for all elements of the list.
polylib::makerat(a)
polylib::makerat(l)
a |
- | polynomial over Expr or arithmetical
expression |
l |
- | list or set of polynomials over Expr or
arithmetical expressions |
polylib::makerat
returns an expression sequence
consisting of three operands:
polylib::makerat
(a)
, otherwise it is a set or
list of polynomials (the same type as the input). The polynomial(s) may
have more indeterminates than the input. The coefficient ring is either
Expr
or a Dom::AlgebraicExtension
; if
it is Expr
, the polynomial has only integer
coefficients.In the simplest case (integer polynomial), the numerator equals the input, the denominator equals 1, and no substitutions are necessary:
>> polylib::makerat(x^2+3)
2 poly(x + 3, [x]), poly(1, [x]), []
Floating point numbers are considered transcendental:
>> polylib::makerat(0.27*x)
poly(x D1, [x, D1]), poly(1, [x, D1]), [D1 = 0.27]
Radicals are replaced by elements of algebraic extensions:
>> polylib::makerat(sqrt(2)/x)
poly(D2, [x], Dom::AlgebraicExtension(Dom::Rational, 2 D2 - 2 = 0, D2)), poly(x, [x], 2 Dom::AlgebraicExtension(Dom::Rational, D2 - 2 = 0, D2)), 1/2 [D2 = 2 ]