Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions

Line 4,193:
 
(lambda (x y)
 
(define ix(make-source 0cf)
(set! ixlet (+ ix(i 10))
(set! iy (+lambda iy 1)()
(let ((term (cf-ref cf i)))
(set! i (+ i 1))
term))))
 
(define no-terms-source (lambda () #f))
 
(define ng ng8)
(define xsource (lambda (i) (cfmake-refsource x i)))
(define ysource (lambda (i) (cfmake-refsource y i)))
(define ix 0)
(define iy 0)
 
;; The procedures "main", "compare-quotients",
Line 4,238 ⟶ 4,245:
(define-values (a12 a1 a2 a b12 b1 b2 b)
(apply values ng))
(define term (xsource ix))
(set! ix (+ ix 1))
(if term
(let ((new-ng (list (+ a2 (* a12 term))
Line 4,252 ⟶ 4,258:
;; Replace the x source with one that returns no
;; terms.
(set! xsource (lambda (i) #f)no-terms-source)
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1)))))
(set! ng (list a12 a1 a12 a1 b12 b1 b12 b1)))
Line 4,260 ⟶ 4,266:
(define-values (a12 a1 a2 a b12 b1 b2 b)
(apply values ng))
(define term (ysource iy))
(set! iy (+ iy 1))
(if term
(let ((new-ng (list (+ a1 (* a12 term)) a12
Line 4,272 ⟶ 4,277:
;; Replace the y source with one that returns no
;; terms.
(set! ysource (lambda (i) #f)no-terms-source)
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2)))))
(set! ng (list a12 a12 a2 a2 b12 b12 b2 b2)))
1,448

edits