︠a1cea32e-1262-44d6-b8d2-3f3176c8d2fcs︠ a = N((2/3)^(1/5)); a ︡a151cfec-e96f-4c03-ad27-f19ba99154df︡{"stdout":"0.922107911481728\n"}︡ ︠f38582ae-b1ec-4e75-8511-ca9cdd5c5177s︠ algdep? ︡55d66787-0986-49c3-8406-a7bb8f94a8b7︡{"code":{"source":"File: /usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/rings/arith.py\nSignature : algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False)\nDocstring :\nReturns a polynomial of degree at most degree which is\napproximately satisfied by the number z. Note that the returned\npolynomial need not be irreducible, and indeed usually won't be if\nz is a good approximation to an algebraic number of degree less\nthan degree.\n\nYou can specify the number of known bits or digits of z with\n\"known_bits=k\" or \"known_digits=k\". PARI is then told to compute\nthe result using 0.8k of these bits/digits. Or, you can specify the\nprecision to use directly with \"use_bits=k\" or \"use_digits=k\". If\nnone of these are specified, then the precision is taken from the\ninput value.\n\nA height bound may be specified to indicate the maximum coefficient\nsize of the returned polynomial; if a sufficiently small polynomial\nis not found, then \"None\" will be returned. If \"proof=True\" then\nthe result is returned only if it can be proved correct (i.e. the\nonly possible minimal polynomial satisfying the height bound, or no\nsuch polynomial exists). Otherwise a \"ValueError\" is raised\nindicating that higher precision is required.\n\nALGORITHM: Uses LLL for real/complex inputs, PARI C-library\n\"algdep\" command otherwise.\n\nNote that \"algebraic_dependency\" is a synonym for \"algdep\".\n\nINPUT:\n\n* \"z\" - real, complex, or p-adic number\n\n* \"degree\" - an integer\n\n* \"height_bound\" - an integer (default: \"None\") specifying the\n maximum\n coefficient size for the returned polynomial\n\n* \"proof\" - a boolean (default: \"False\"), requires height_bound to\n be set\n\nEXAMPLES:\n\n sage: algdep(1.888888888888888, 1)\n 9*x - 17\n sage: algdep(0.12121212121212,1)\n 33*x - 4\n sage: algdep(sqrt(2),2)\n x^2 - 2\n\nThis example involves a complex number:\n\n sage: z = (1/2)*(1 + RDF(sqrt(3)) *CC.0); z\n 0.500000000000000 + 0.866025403784439*I\n sage: p = algdep(z, 6); p\n x^3 + 1\n sage: p.factor()\n (x + 1) * (x^2 - x + 1)\n sage: z^2 - z + 1\n 0.000000000000000\n\nThis example involves a p-adic number:\n\n sage: K = Qp(3, print_mode = 'series')\n sage: a = K(7/19); a\n 1 + 2*3 + 3^2 + 3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 3^11 + 3^12 + 2*3^15 + 2*3^16 + 3^17 + 2*3^19 + O(3^20)\n sage: algdep(a, 1)\n 19*x - 7\n\nThese examples show the importance of proper precision control. We\ncompute a 200-bit approximation to sqrt(2) which is wrong in the\n33'rd bit:\n\n sage: z = sqrt(RealField(200)(2)) + (1/2)^33\n sage: p = algdep(z, 4); p\n 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088\n sage: factor(p)\n 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088\n sage: algdep(z, 4, known_bits=32)\n x^2 - 2\n sage: algdep(z, 4, known_digits=10)\n x^2 - 2\n sage: algdep(z, 4, use_bits=25)\n x^2 - 2\n sage: algdep(z, 4, use_digits=8)\n x^2 - 2\n\nUsing the \"height_bound\" and \"proof\" parameters, we can see that pi\nis not the root of an integer polynomial of degree at most 5 and\ncoefficients bounded above by 10:\n\n sage: algdep(pi.n(), 5, height_bound=10, proof=True) is None\n True\n\nFor stronger results, we need more precicion:\n\n sage: algdep(pi.n(), 5, height_bound=100, proof=True) is None\n Traceback (most recent call last):\n ...\n ValueError: insufficient precision for non-existence proof\n sage: algdep(pi.n(200), 5, height_bound=100, proof=True) is None\n True\n\n sage: algdep(pi.n(), 10, height_bound=10, proof=True) is None\n Traceback (most recent call last):\n ...\n ValueError: insufficient precision for non-existence proof\n sage: algdep(pi.n(200), 10, height_bound=10, proof=True) is None\n True\n\nWe can also use \"proof=True\" to get positive results:\n\n sage: a = sqrt(2) + sqrt(3) + sqrt(5)\n sage: algdep(a.n(), 8, height_bound=1000, proof=True)\n Traceback (most recent call last):\n ...\n ValueError: insufficient precision for uniqueness proof\n sage: f = algdep(a.n(1000), 8, height_bound=1000, proof=True); f\n x^8 - 40*x^6 + 352*x^4 - 960*x^2 + 576\n sage: f(a).expand()\n 0\n\nTESTS:\n\n sage: algdep(complex(\"1+2j\"), 4)\n x^2 - 2*x + 5","mode":"text/x-rst","lineno":-1,"filename":null}}︡ ︠c86e24be-e95a-47f7-a035-13d8c83a379as︠ algdep(a,5) ︡f7d4d6cf-d143-45d4-b96c-d176c481f4b7︡{"stdout":"3*x^5 - 2"}︡{"stdout":"\n"}︡ ︠522426fd-c49b-4bad-ab8e-318033764bd3︠