Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Formula Manipulation > Algebraic Transformations > Algebraic Numbers >
Mathematica > Mathematics and Algorithms > Number Theory > Algebraic Number Theory > Algebraic Numbers >
Mathematica > Mathematics and Algorithms > Mathematical Functions > Number Theoretic Functions > Algebraic Number Theory > Algebraic Numbers >

RootApproximant

Updated In 7 Graphic
RootApproximant[x]
converts the number x to one of the "simplest" algebraic numbers that approximates it well.
RootApproximant[x, n]
finds 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->{"DegreeCost"->p} specifies an additional cost p to be used for each successively higher power in determining the "simplest" approximation.
Find a quadratic approximation to Pi:
Find algebraic approximants of any order:
There is no simple quadratic approximation to :
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:
Assigning additional cost to higher powers can be used to lower the degree of result:
Find successive algebraic approximations to Pi:
A complicated radical expression:
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:
New in 6 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team