Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions
Content added Content deleted
Line 4,156: | Line 4,156: | ||
(define ng ng8) |
(define ng ng8) |
||
(define xsource x) |
(define xsource (lambda (i) (cf-ref x i))) |
||
(define ysource y) |
(define ysource (lambda (i) (cf-ref y i))) |
||
(define ix 0) |
(define ix 0) |
||
(define iy 0) |
(define iy 0) |
||
Line 4,199: | Line 4,199: | ||
(define-values (a12 a1 a2 a b12 b1 b2 b) |
(define-values (a12 a1 a2 a b12 b1 b2 b) |
||
(apply values ng)) |
(apply values ng)) |
||
(define term ( |
(define term (xsource ix)) |
||
(set! ix (+ ix 1)) |
(set! ix (+ ix 1)) |
||
(if term |
(if term |
||
Line 4,213: | Line 4,213: | ||
;; Replace the x source with one that returns no |
;; Replace the x source with one that returns no |
||
;; terms. |
;; terms. |
||
(set! xsource (lambda |
(set! xsource (lambda (i) #f)) |
||
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1))))) |
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1))))) |
||
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1))) |
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1))) |
||
Line 4,221: | Line 4,221: | ||
(define-values (a12 a1 a2 a b12 b1 b2 b) |
(define-values (a12 a1 a2 a b12 b1 b2 b) |
||
(apply values ng)) |
(apply values ng)) |
||
(define term ( |
(define term (ysource iy)) |
||
(set! iy (+ iy 1)) |
(set! iy (+ iy 1)) |
||
(if term |
(if term |
||
Line 4,233: | Line 4,233: | ||
;; Replace the y source with one that returns no |
;; Replace the y source with one that returns no |
||
;; terms. |
;; terms. |
||
(set! ysource (lambda |
(set! ysource (lambda (i) #f)) |
||
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2))))) |
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2))))) |
||
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2))) |
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2))) |