This package defines the function Recognize for determining a polynomial with integer coefficients, given an approximate real zero of the polynomial and the degree of the polynomial. The resulting polynomial is normally not unique.
Determining a polynomial from a solution.
This loads the package.
In:= << NumberTheory`Recognize`
This finds a linear polynomial in t with solution 1.7.
In:= Recognize[1.7, 1, t]
NSolve gives the numerical solutions of a cubic equation.
In:= NSolve[3 x^3 - 2 x + 5 == 0]
Here is the first solution.
In:= sol = First[x /. %]
This result is proportional to the original polynomial used in NSolve.
In:= Recognize[sol, 3, t]
Here is a quadratic polynomial for which sol is an approximate solution.
In:= Recognize[sol, 2, t]
This result is a polynomial of degree 5.
In:= Recognize[N[Sqrt[3^(2/5)]], 5, t]
If the penalty is large enough, a lower-order polynomial may be returned.
In:= Recognize[N[Sqrt[3^(2/5)]], 5, t, 10]