This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# RootApproximant

 RootApproximant[x]converts the number x to one of the "simplest" algebraic numbers that approximates it well. RootApproximantfinds an algebraic number of degree at most n that approximates x.
• RootApproximant[x] effectively tests the total number of bits in the description of x by successively higher-degree algebraic numbers, and returns the first case for which the number of bits is small.
• The option Method specifies an additional cost p to be used for each successively higher power in determining the "simplest" approximation.
Find a quadratic approximation to :
Find algebraic approximants of any order:
Find a quadratic approximation to :
 Out[1]=
 Out[2]=

Find algebraic approximants of any order:
 Out[1]=
 Out[2]=
 Out[3]=
 Scope   (4)
There is no simple quadratic approximation to N:
At degree 4, there is a simple answer, which turns out to be equal to :
Machine precision is not enough to recover the Root object equal to :
30 digits of precision suffice to recover the exact value here:
When given exact input, RootApproximant uses machine-precision approximations:
RootApproximant works with complex numbers:
 Options   (1)
Assigning additional cost to higher powers can be used to lower the degree of result:
 Applications   (2)
Find successive algebraic approximations to :
Use FindRoot to find the real root near 2.5:
Use RootApproximant to find an algebraic number close to the root:
Check whether the result is a root of the original expression:
RootApproximant gives a Root object close to a given algebraic number:
The Root object found may not be exactly equal to the input:
Use RootReduce to find exact Root object representations of algebraic numbers:
Specifying a linear polynomial effectively finds a rational approximation to x:
Rationalize also gives a rational approximation, but it need not be the same:
Interestingly, the approximations can be found among continued fraction convergents:
Use LatticeReduce to recognize linear combinations of more general functions:
The final relationship :
Recognizing an algebraic number may require using higher precision:
The result is not equal to a:
Providing the correct degree improves the chances of recognizing an algebraic number:
A penalty may be used to lower the degree; here it does not help in recognizing the number:
Using a higher-precision approximation allows the algebraic number to be recognized: