packages feed

egison-3.7.8: sample/math/number/7th-root-of-unity.egi

;(gen-cyclic-group (map 1#(modulo (* %1 3) 7) (between 1 6)))
;{{3 6 2 5 1 4} {2 4 6 1 3 5} {6 5 4 3 2 1} {4 1 5 2 6 3} {5 3 1 6 4 2} {1 2 3 4 5 6}}

(define $z (rtu 7))

(define $a11 (+ z^1 z^6))
(define $a12 (+ z^2 z^5))
(define $a13 (+ z^3 z^4))

(define $b10 (+ a11 a12 a13))

(define $b10' b10)

b10';-1

(define $b11 (+ a11 (* w a12) (* w^2 a13)))
(define $b12 (+ a13 (* w a11) (* w^2 a12)));(* w b11)
(define $b13 (+ a12 (* w a13) (* w^2 a11)));(* w^2 b11)

(define $b11' (rt 3 (* b11 b12 b13)))

b11';(rt 3 (+ 14 (* 21 w)))

(define $b14 (+ a11 (* w a13) (* w^2 a12)))
(define $b15 (+ a12 (* w a11) (* w^2 a13)));(* w b14)
(define $b16 (+ a13 (* w a12) (* w^2 a11)));(* w^2 b14)

(define $b14' (rt 3 (* b14 b15 b16)))

b14';(rt 3 (+ -7 (* -21 w)))

(define $a11' (/ (+ b10' b11' b14') 3))

a11';(/ (+ -1 (rt 3 (+ 14 (* 21 w))) (rt 3 (+ -7 (* -21 w)))) 3)


(define $z1' (fst (q-f' 1 (* -1 a11') 1)))

z1';(/ (+ -1 (rt 3 (+ 14 (* 21 w))) (rt 3 (+ -7 (* -21 w))) (sqrt (+ -35 (* -2 (rt 3 (+ 14 (* 21 w)))) (* -2 (rt 3 (+ -7 (* -21 w)))) (rt 3 (+ 14 (* 21 w)))^2 (* 2 (rt 3 (+ 14 (* 21 w))) (rt 3 (+ -7 (* -21 w)))) (rt 3 (+ -7 (* -21 w)))^2))) 6)

(/ (+ -1
      (rt 3 (+ 14 (* 21 w)))
      (rt 3 (+ -7 (* -21 w)))
      (sqrt (+ -35
               (* -2 (rt 3 (+ 14 (* 21 w))))
               (* -2 (rt 3 (+ -7 (* -21 w))))
               (rt 3 (+ 14 (* 21 w)))^2
               (rt 3 (+ -7 (* -21 w)))^2
               (* 2
                  (rt 3 (+ 14 (* 21 w)))
                  (rt 3 (+ -7 (* -21 w))))
               )))
   6)