§ Using LLL to discover minimal polynomial for floating point number
- Explain by example. Let floating point number f=1.4142.
- Clearly, this has a minpoly of 10000x−14142=0 with coefficients in Z[x].
- However, we know that the correct minpoly is x2−2=0.
- What's the difference in these two cases? Well, the correct minpoly has "small" coefficients.
- How do we find such a minpoly using LLL?
- Key idea: Build vectors (in our case) of the form b0≡(1,0,0,1000), b1≡(0,1,0,1000f), and b2≡(1000f2). Then LLL, on trying to find a shorter basis for these, will try very hard to make the third component smaller. It will do this by changing the basis vectors to b0′≡b0,b1′≡b1, and b2′≡b2−2b0=(−1,0,1,1000(f2−2). Since f2−2∼0, the length of b2′is much smaller than b2, granting us a shorter basis!
- In general, given some rational number θ, we build
n
basis vectors v_i
of dimension n+1
of the form v_i[i] = 1
, v_i[n] = 1000(θ^i)
, and v_i[-] = 0
otherwise. - LLLing on these vectors
v_i
will attempt to find an integer relation on the last coefficient, which will be the minpoly.