summaryrefslogtreecommitdiffstats
path: root/divers
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2012-03-08 20:50:12 (GMT)
committerDavid A. Madore <david+git@madore.org>2012-03-08 20:50:12 (GMT)
commit9326588869d3144ef17e1324c688103e1ae88c82 (patch)
tree26546a77d879e3e7cf0cc1f0575cdfb2133fb6ce /divers
parentb4f7969f03c9acc931112ee17b82fc160963db94 (diff)
downloadgalois-9326588869d3144ef17e1324c688103e1ae88c82.zip
galois-9326588869d3144ef17e1324c688103e1ae88c82.tar.gz
galois-9326588869d3144ef17e1324c688103e1ae88c82.tar.bz2
[radicaux] Expression brute de cos(2π/17).
Diffstat (limited to 'divers')
-rw-r--r--divers/sageries/racine-17e-de-132
1 files changed, 32 insertions, 0 deletions
diff --git a/divers/sageries/racine-17e-de-1 b/divers/sageries/racine-17e-de-1
new file mode 100644
index 0000000..31af5b9
--- /dev/null
+++ b/divers/sageries/racine-17e-de-1
@@ -0,0 +1,32 @@
+K.<omega> = CyclotomicField(17)
+sqrt17 = sum([(-1)^i*omega^(3^i) for i in range(16)])
+sub2 = [sum([(-1)^i*omega^(3^j*9^i) for i in range(8)]) for j in range(2)]
+sub4 = [sum([(-1)^i*omega^(3^j*13^i) for i in range(4)]) for j in range(4)]
+sub8 = [sum([(-1)^i*omega^(3^j*16^i) for i in range(2)]) for j in range(8)]
+nice_basis = [1, sqrt17] + sub2 + sub4 + sub8
+for i in range(16):
+ z = CC(nice_basis[i])
+ if z.real_part()<=-0.0001 or (abs(z.real_part())<0.0001 and z.imag_part()<0):
+ nice_basis[i] = -nice_basis[i]
+
+sub2 = nice_basis[2:4]
+sub4 = nice_basis[4:8]
+sub8 = nice_basis[8:16]
+m = Matrix(QQ, 16, 16, [(QQ^16)((omega.coordinates_in_terms_of_powers())(x)) for x in nice_basis])
+def on_nice_basis(x):
+ return (QQ^16)((omega.coordinates_in_terms_of_powers())(x)) * m.inverse()
+
+symbolic_sqrt17 = sqrt(17)
+symbolic_basis = [1, symbolic_sqrt17]
+def symbolicize(x):
+ v = on_nice_basis(x)
+ return sum([v[i]*symbolic_basis[i] for i in range(16) if v[i]!=0])
+
+symbolic_sub2 = [sqrt(symbolicize(x^2)) for x in sub2]
+symbolic_basis = symbolic_basis + symbolic_sub2
+symbolic_sub4 = [sqrt(symbolicize(x^2)) for x in sub4]
+symbolic_basis = symbolic_basis + symbolic_sub4
+symbolic_sub8 = [sqrt(symbolicize(x^2)) for x in sub8]
+symbolic_basis = symbolic_basis + symbolic_sub8
+symbolic_cos = symbolicize((omega+omega^-1)/2)
+symbolic_omega = symbolicize(omega)