![]() | ![]() | ![]() | Exercises | Documentation and user's manual | Table of contents | OCaml programs |
Given a non-zero polynomial p in one variable X whose coefficients are real numbers (i.e., in R[X]), how to compute the number of its real roots and how to get an approximation of each of them as accurate as desired?
Sturm's theorem defines, given any open interval i of R none of the bounds of which is a root of p, the number ni of real roots of p in i. Another theorem gives an open interval out of which p has no real root. Unfortunately if at least one coefficient of p or one bound of i is an irrational number (i.e., belongs to R- Q) then approximations when trying to compute ni can lead to an incorrect result or to no result at all (error or looping). But exact results can be obtained when computing with rational numbers (i.e., belongs to Q) using arbitrary-precision numbers. This is why only polynomials whose coefficients are rational numbers are here considered. The aim here is to compute the number of real roots of any non-zero polynomial p in Q[X] and to get for each of them an interval (whose bounds are rational numbers) that contains it and is as smallest as desired. |
![]() | ![]() | ![]() | Exercises | Documentation and user's manual | Table of contents | OCaml programs |