up previous next
RealRootsApprox    --    approximations to the real roots of a univariate poly


Syntax
RealRootsApprox(F: RINGELEM): LIST
RealRootsApprox(F: RINGELEM, Precision: RAT): LIST
RealRootsApprox(F: RINGELEM, Precision: RAT, Interval:[RAT, RAT]): LIST

Description
This function computes rational approximations to the real roots of a univariate polyomial (with rational coefficients).

An optional second argument specifies the maximum separation between the approximations produced and the corresponding exact root. An optional third argument specifies a closed interval in which to search for roots.

NOTE: the value of F at an approximate root may not be small; see also ApproxSolve which uses a heuristic to produce approximate roots such that the evaluation is also "small".

Example
/**/  use QQ[x];
/**/  RealRootsApprox(x^2-2);
[-3037000499/2147483648, 3037000499/2147483648]

/**/  RR := RealRootsApprox(x^2-2, 10^(-15), [0, 2]);
/**/  FloatStr(RR[1], 15); --> print as a decimal, easier to read
1.41421356237310*10^0

See Also