RootApproximant
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.
Details and Options
- For degrees above 2, RootApproximant generates Root objects.
- 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.
- Results from RootApproximant may not be unique.
- MinimalPolynomial yields the minimal polynomial for the result of RootApproximant.
- The option Method->{"DegreeCost"->p} specifies an additional cost p to be used for each successively higher power in determining the "simplest" approximation.
Examples
open allclose allScope (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)
Applications (2)
Find successive algebraic approximations to :
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:
Properties & Relations (3)
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:
Possible Issues (1)
Recognizing an algebraic number may require using higher precision:
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:
Text
Wolfram Research (2007), RootApproximant, Wolfram Language function, https://reference.wolfram.com/language/ref/RootApproximant.html (updated 2008).
CMS
Wolfram Language. 2007. "RootApproximant." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/RootApproximant.html.
APA
Wolfram Language. (2007). RootApproximant. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RootApproximant.html