Fix tests for new output.

This commit is contained in:
Sam Tobin-Hochstadt 2010-08-26 16:58:18 -04:00
parent 52c90628ce
commit 7fc38693ec
5 changed files with 64 additions and 63 deletions

View File

@ -1,8 +1,18 @@
#lang typed/scheme #lang typed/scheme
(require racket/unsafe/ops) (require racket/unsafe/ops)
(map (lambda: ((x : Inexact-Complex)) (map (lambda: ((x : Inexact-Complex))
(string-append (real->decimal-string (unsafe-flreal-part x) 10) (string-append (real->decimal-string
(real->decimal-string (unsafe-flimag-part x) 10))) (let* ([unboxed-gensym-1 x]
[unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1)]
[unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1)])
unboxed-real-2)
10)
(real->decimal-string
(let* ([unboxed-gensym-1 x]
[unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1)]
[unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1)])
unboxed-imag-3)
10)))
(list (list
(let* ((unboxed-float-1 1.0) (let* ((unboxed-float-1 1.0)
(unboxed-real-2 2.0) (unboxed-real-2 2.0)

View File

@ -26,7 +26,7 @@
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
(let* ((unboxed-real-1 1.0) (let* ((unboxed-real-1 1.0)
(unboxed-imag-2 2.0) (unboxed-imag-2 2.0)
(unboxed-float-3 (unsafe-fl+ 1.0 2.0)) (unboxed-float-5 (unsafe-fl+ 1.0 2.0))
(unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3)) (unboxed-real-6 (unsafe-fl+ unboxed-real-1 unboxed-float-5))
(unboxed-imag-5 unboxed-imag-2)) (unboxed-imag-7 unboxed-imag-2))
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))

View File

@ -4,57 +4,48 @@
(let* ((unboxed-real-1 1.0) (let* ((unboxed-real-1 1.0)
(unboxed-imag-2 2.0) (unboxed-imag-2 2.0)
(unboxed-float-1 (let* ((unboxed-real-1 2.0) (unboxed-real-3 2.0)
(unboxed-imag-2 4.0) (unboxed-imag-4 4.0)
(unboxed-real-3 3.0) (unboxed-real-5 3.0)
(unboxed-imag-4 6.0) (unboxed-imag-6 6.0)
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
unboxed-real-3)) (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
unboxed-imag-4))) (unboxed-imag-10 unboxed-imag-2))
unboxed-real-5)) (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
(unboxed-imag-3 unboxed-imag-2))
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
(let* ((unboxed-real-1 1.0) (let* ((unboxed-real-1 1.0)
(unboxed-imag-2 2.0) (unboxed-imag-2 2.0)
(unboxed-float-1 (let* ((unboxed-real-1 2.0) (unboxed-real-3 2.0)
(unboxed-imag-2 4.0) (unboxed-imag-4 4.0)
(unboxed-real-3 3.0) (unboxed-real-5 3.0)
(unboxed-imag-4 6.0) (unboxed-imag-6 6.0)
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
unboxed-real-3)) (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
unboxed-imag-4))) (unboxed-imag-10 unboxed-imag-2))
unboxed-real-5)) (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
(unboxed-imag-3 unboxed-imag-2))
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
(let* ((unboxed-real-1 1.0) (let* ((unboxed-real-1 1.0)
(unboxed-imag-2 2.0) (unboxed-imag-2 2.0)
(unboxed-float-1 (let* ((unboxed-real-1 2.0) (unboxed-real-3 2.0)
(unboxed-imag-2 4.0) (unboxed-imag-4 4.0)
(unboxed-real-3 3.0) (unboxed-real-5 3.0)
(unboxed-imag-4 6.0) (unboxed-imag-6 6.0)
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
unboxed-real-3)) (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-imag-8))
unboxed-imag-4))) (unboxed-imag-10 unboxed-imag-2))
unboxed-imag-6)) (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
(unboxed-imag-3 unboxed-imag-2))
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
(let* ((unboxed-real-1 1.0) (let* ((unboxed-real-1 1.0)
(unboxed-imag-2 2.0) (unboxed-imag-2 2.0)
(unboxed-float-1 (let* ((unboxed-real-1 2.0) (unboxed-real-3 2.0)
(unboxed-imag-2 4.0) (unboxed-imag-4 4.0)
(unboxed-real-3 3.0) (unboxed-real-5 3.0)
(unboxed-imag-4 6.0) (unboxed-imag-6 6.0)
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
unboxed-real-3)) (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-imag-8))
unboxed-imag-4))) (unboxed-imag-10 unboxed-imag-2))
unboxed-imag-6)) (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
(unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1))
(unboxed-imag-3 unboxed-imag-2))
(unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))

View File

@ -9,10 +9,10 @@
(lambda (unboxed-real-1 unboxed-imag-2 l) (lambda (unboxed-real-1 unboxed-imag-2 l)
(if (null? l) (if (null? l)
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2) (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)
(let*-values (((unboxed-float-3) (->fl (unsafe-car l))) (let*-values (((unboxed-float-1) (->fl (unsafe-car l)))
((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3)) ((unboxed-real-2) (unsafe-fl+ unboxed-real-1 unboxed-float-1))
((unboxed-imag-5) unboxed-imag-2)) ((unboxed-imag-3) unboxed-imag-2))
(loop unboxed-real-4 unboxed-imag-5 (loop unboxed-real-2 unboxed-imag-3
(unsafe-cdr l))))))) (unsafe-cdr l)))))))
loop) loop)
unboxed-real-1 unboxed-imag-2 '(1 2 3))) unboxed-real-1 unboxed-imag-2 '(1 2 3)))

View File

@ -17,9 +17,9 @@
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
(if (even? 2) (if (even? 2)
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6) (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)
(let*-values (((unboxed-real-7) 2.0) (let*-values (((unboxed-real-1) 2.0)
((unboxed-imag-8) 4.0) ((unboxed-imag-2) 4.0)
((unboxed-real-9) (unsafe-fl+ unboxed-real-5 unboxed-real-7)) ((unboxed-real-3) (unsafe-fl+ unboxed-real-5 unboxed-real-1))
((unboxed-imag-10) (unsafe-fl+ unboxed-imag-6 unboxed-imag-8))) ((unboxed-imag-4) (unsafe-fl+ unboxed-imag-6 unboxed-imag-2)))
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))) (unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4))))
(void) (void)