identify - Maple Help

# Online Help

###### All Products    Maple    MapleSim

identify

find a closed form for a decimal approximation of a number

 Calling Sequence identify(x,opts)

Parameters

 x - a real or complex floating-point number or expression opts - equations in the form of option=value, where option is one of all, BasisSizeAlg, BasisPolyConst, BasisProdConst, BasisSumConst, extension, LearnBasis, Rational, Algebraic, FuncRat, FuncAlg, PolyConst, FuncPoly, SumConst, FuncSum, ProdConst, and FuncProd.

Description

 • If the input is a floating-point constant x, for example, $1.414213562$, the identify command searches for an exact expression for the number. In this case, it determines that this is the constant $\sqrt{2}$.
 • If the input is a complex floating-point constant, for example, $1.386294361+3.141592654I$, the identify command is applied to the real and imaginary parts separately.  In this case, it determines that this is the constant $2\mathrm{ln}\left(2\right)+I\mathrm{\pi }$.
 • The identify command applies the tests listed in the following section. If the input cannot be identified as an exact constant, then the numerical value x is returned. For the identify command to succeed, enough digits must be provided to approximate the number.
 • If the input is not a (complex) floating-point constant, then the identify command maps recursively over the input expression applying itself to each floating-point constant in the expression.

Applied Tests

 The tests made are as follows.
 1 Test if x rational.
 2 Test if x is algebraic of degree 6 (default) or less.
 3 Test if x is a function of a rational number e.g. $\mathrm{ln}\left(5\right)$.
 4 Test if x is a function of an algebraic number of degree 6 or less.
 5 Test if x is of the form ${a}_{1}+{a}_{2}\sqrt{t}+\frac{{a}_{3}}{\sqrt{t}}+{a}_{4}t+\frac{{a}_{5}}{t}+\mathrm{...}+{a}_{n}{t}^{k}$ where $t$ is a known transcendental constant e.g. $\mathrm{\pi }$ or $ⅇ$ or $\mathrm{ln}\left(2\right)$.
 6 (optional) Test if x is a function of the above form.
 7 Test if x is of the form ${a}_{1}{t}_{1}+{a}_{2}{t}_{2}+{a}_{n}{t}_{n}+\mathrm{...}+{a}_{0}$ where ${t}_{i}$ are known algebraic or transcendental constants.
 8 (optional) Test if x is a function of the above form.
 9 Test if x is of the form ${t}_{1}^{{a}_{1}}{t}_{2}^{{a}_{2}}\mathrm{...}{t}_{n}^{{a}_{n}}$ where ${t}_{i}$ are certain constants and ${a}_{i}$ are rational.
 10 (optional) Test if x is a function of the above form.
 • The test for rational constants is made by looking at the continued fraction expansion of x.  The test for an algebraic number up to degree 6, that is, a root of a polynomial $m\left(z\right)$ of degree 6 or less, is made by applying Bailey and Ferguson's IntegerRelations[PSLQ] algorithm to $[{x}^{0},{x}^{1},{x}^{2},...,{x}^{6}]$ to compute the minimal polynomial $m\left(z\right)$ for x and then solving for the roots and selecting the right one. If the solve command is not able to solve for the root in terms of radicals, the answer may be returned in the form of a RootOf.

Options

 The remaining arguments to the identify command are treated as options.  They are equations of the form option=value. The following options are supported.
 all
 The option all=true specifies trying all tests, including the optional ones. The option all=false specifies only the tests that are explicitly asked for, as specified below.
 BasisSizeAlg
 The option BasisSizeAlg=n specifies when testing whether x is an algebraic number, to search up to degree $n$ (default is 6).
 BasisPolyConst
 The option BasisPolyConst=B1 specifies the use of basis $\mathrm{B1}$, a list of real constants (default is $\left[\mathrm{\pi },ⅇ,\mathrm{ln}\left(2\right)\right]$, when making test 5, that is, $t$ is chosen from this list.
 BasisSizePoly
 The option BasisSizePoly=n specifies the value of $n$ to use in test 5.
 BasisSumConst
 The option BasisSumConst=B2 specifies the use of basis $\mathrm{B2}$, a list of real constants (default is $\left[1,\sqrt{2},\sqrt{3},\mathrm{\pi },\mathrm{ln}\left(2\right),\mathrm{ln}\left(3\right),\mathrm{\zeta }\left(3\right),\mathrm{\zeta }\left(5\right)\right]$) when making test 7, that is, ${t}_{i}$ is chosen from this list.
 BasisSizeSum
 The option BasisSizeSum=n specifies the value of $n$ to use in test 7 (default 3).
 BasisProdConst
 The option BasisProdConst=B3 specifies the use of basis $\mathrm{B3}$, a list of real constants (default is $\left[2,3,5,7,\mathrm{\pi },ⅇ,\mathrm{ln}\left(2\right),\mathrm{ln}\left(3\right),\mathrm{\zeta }\left(3\right),\mathrm{\zeta }\left(5\right)\right]$) when making test 9, that is, ${t}_{i}$ is chosen from this list.
 BasisSizeProd
 The option BasisSizeProd=n specifies the value of $n$ to use in test 9 (default 3).
 extension
 The option extension=B specifies adding the elements of $B$, a list of real constants, to the bases $\mathrm{B1},\mathrm{B2},\mathrm{B3}$, when making tests 5, 7, and 9.
 LearnBasis
 The option LearnBasis=true specifies the use of nonrational constants found in tests 1-4 when making tests 5-10.  The default for this option is false.
 Rational, Algebraic, FuncRat, FuncAlg, PolyConst, SumConst, and ProdConst
 The options Rational=false, Algebraic=false, FuncRat=false, FuncAlg=false, PolyConst=false, SumConst=false, and ProdConst=false specify not to perform tests 1, 2, 3, 4, 5, 7, and 9 respectively.
 FuncPoly, FuncSum, and FuncProd
 The options FuncPoly=true, FuncSum=true, FuncProd=true specify the performance of tests 6, 8 and 10 respectively.

Examples

 > $\mathrm{identify}\left(3.142857143\right)$
 $\frac{{22}}{{7}}$ (1)
 > $\mathrm{identify}\left(3.146264370\right)$
 $\sqrt{{2}}{+}\sqrt{{3}}$ (2)
 > $\mathrm{identify}\left(3.141701399\right)$
 ${\mathrm{arcsinh}}{}\left(\frac{{231}}{{20}}\right)$ (3)
 > $\mathrm{identify}\left(3.141592654\right)$
 ${\mathrm{\pi }}$ (4)
 > $\mathrm{identify}\left(2.596684952\right)$
 ${3}{+}{\mathrm{\pi }}{-}{2}{}\sqrt{{\mathrm{\pi }}}$ (5)
 > $\mathrm{identify}\left(0.7692389013,\mathrm{all}=\mathrm{false},\mathrm{FuncPoly}=\mathrm{true}\right)$
 ${\mathrm{cos}}{}\left({\mathrm{ln}}{}\left({2}\right)\right)$ (6)
 > $\mathrm{identify}\left(2.7889921029138087050,\mathrm{BasisPolyConst}=\left[\mathrm{Catalan}\right]\right)$
 ${2}{}{\mathrm{Catalan}}{+}\sqrt{{\mathrm{Catalan}}}$ (7)
 > $f≔0.1428571429{x}^{2}+8.885765876x+9.869604404$
 ${f}{≔}{0.1428571429}{}{{x}}^{{2}}{+}{8.885765876}{}{x}{+}{9.869604404}$ (8)
 > $\mathrm{identify}\left(f\right)$
 $\frac{{{x}}^{{2}}}{{7}}{+}{2}{}\sqrt{{2}}{}{\mathrm{\pi }}{}{x}{+}{{\mathrm{\pi }}}^{{2}}$ (9)
 > $f≔\mathrm{expand}\left({\left(\left(\mathrm{sqrt}\left(2\right)+\mathrm{\pi }\right)y+1\right)}^{2}\right)$
 ${f}{≔}{2}{}{{y}}^{{2}}{+}{2}{}{{y}}^{{2}}{}\sqrt{{2}}{}{\mathrm{\pi }}{+}{2}{}{y}{}\sqrt{{2}}{+}{{y}}^{{2}}{}{{\mathrm{\pi }}}^{{2}}{+}{2}{}{y}{}{\mathrm{\pi }}{+}{1}$ (10)
 > $f≔\mathrm{evalf}\left(f\right)$
 ${f}{≔}{20.75537028}{}{{y}}^{{2}}{+}{9.111612432}{}{y}{+}{1.}$ (11)
 > $\mathrm{identify}\left(f\right)$
 ${20.75537028}{}{{y}}^{{2}}{+}\left({2}{}\sqrt{{2}}{+}{2}{}{\mathrm{\pi }}\right){}{y}{+}{1}$ (12)
 > $\mathrm{identify}\left(f,\mathrm{LearnBasis}=\mathrm{true}\right)$
 $\frac{{\left({2}{}\sqrt{{2}}{+}{2}{}{\mathrm{\pi }}\right)}^{{2}}{}{{y}}^{{2}}}{{4}}{+}\left({2}{}\sqrt{{2}}{+}{2}{}{\mathrm{\pi }}\right){}{y}{+}{1}$ (13)
 > $z≔\mathrm{evalf}\left(\mathrm{exp}\left(\frac{I\mathrm{\pi }}{5}\right),20\right)$
 ${z}{≔}{0.80901699437494742410}{+}{0.58778525229247312917}{}{I}$ (14)
 > $\mathrm{identify}\left(z\right)$
 $\frac{\sqrt{{5}}}{{4}}{+}\frac{{1}}{{4}}{+}\frac{{I}{}\sqrt{{10}{-}{2}{}\sqrt{{5}}}}{{4}}$ (15)

 See Also