; http://people.math.gatech.edu/~mbaker/pdf/cipolla2011.pdf ; this value is mutable because of variable rg. (let ((ff (fileVal "finiteField"))(J (fileVal "Jacobi")) (rg (((fileVal "RC4") "froth") 'rbi))) (lambda (p) (let ((rx (rg (- p 1)))(Fp (ff p))) (lambda (a) (let ((jt (J a p))) (if (< jt 0) 'none (if (= jt 0) 0 (let ((m+ (Fp 'm+)) (m- (Fp 'm-)) (m* (Fp 'm*)) (fops (Fp 'fops))) (let y () (let* ((t (+ 1 (rx)))(w2 (m+ (m* t t) (m- a)))) (if (= (J w2 p) 1) (y) (vector-ref (((fops (list->vector (list (m- w2) 0 1))) 'fexpt) (list->vector (list t 1)) (arithmetic-shift (+ p 1) -1)) 0)))))))))))) ; (t 49 103) ; produces a complex vector!! ; t = 96, w2 = 0, final field val = (7, 51) ; The real part is right. (((fileVal "GFsqrt") 17) 2) ; => 11 (11*11=121 = 119+2 = 17*7+2) (let* ((p ((fileVal "pias") 4000000000000000000000 7)) (rx ((((fileVal "RC4") "foth") 'rbi) (- p 1)))(sqrt ((fileVal "GFsqrt") p))) (cons (let w ((i 1000)) (or (zero? i) (and (let* ((r (rx)) (y (sqrt (modulo (* r r) p)))) (or (= y r) (= y (- p r)))) (w (- i 1))))) (let w ((i 10000)(R 0)) (or (and (zero? i) R) (and (let* ((r (rx)) (y (sqrt r))) (or (and (eq? y 'none) (w (- i 1) R)) (and (= (modulo (* y y) p) r) (w (- i 1) (+ R 1)))))))))) ; => (#t . 4970)