Changed optimization order for reals in complex operations.
Made generated names more informative and updated tests accordingly.
This commit is contained in:
parent
d7ff2ed665
commit
c653a8e655
|
@ -1,10 +1,10 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl- 0.0 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))
|
||||
(unboxed-imag-7 (unsafe-fl- 0.0 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-7))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 (unsafe-fl- 0.0 unboxed-gensym-2))
|
||||
(unboxed-gensym-4 2.0)
|
||||
(unboxed-gensym-5 4.0)
|
||||
(unboxed-gensym-6 (unsafe-fl- 0.0 unboxed-gensym-5))
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-4))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-imag-3 (unsafe-fl- 0.0 unboxed-imag-2))
|
||||
(unboxed-real-4 2.0)
|
||||
(unboxed-imag-5 4.0)
|
||||
(unboxed-imag-6 (unsafe-fl- 0.0 unboxed-imag-5))
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-1 unboxed-real-4))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-3 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
(module inexact-complex-div typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3 unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-4 unboxed-gensym-4)))
|
||||
(unboxed-gensym-9 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-4))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-3 unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-4 unboxed-imag-4)))
|
||||
(unboxed-real-9 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-1
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-2
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-11))
|
||||
(unboxed-gensym-10 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-4))
|
||||
(unboxed-imag-10 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-2
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-real-1
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-11))
|
||||
(unboxed-gensym-12 (unsafe-fl+ (unsafe-fl* unboxed-gensym-5 unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-6 unboxed-gensym-6)))
|
||||
(unboxed-gensym-7 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-10
|
||||
unboxed-gensym-6))
|
||||
(unboxed-gensym-12 (unsafe-fl+ (unsafe-fl* unboxed-real-5 unboxed-real-5)
|
||||
(unsafe-fl* unboxed-imag-6 unboxed-imag-6)))
|
||||
(unboxed-real-7 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-9
|
||||
unboxed-real-5)
|
||||
(unsafe-fl* unboxed-imag-10
|
||||
unboxed-imag-6))
|
||||
unboxed-gensym-12))
|
||||
(unboxed-gensym-8 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-10
|
||||
unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-6))
|
||||
(unboxed-imag-8 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-10
|
||||
unboxed-real-5)
|
||||
(unsafe-fl* unboxed-real-9
|
||||
unboxed-imag-6))
|
||||
unboxed-gensym-12)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 (unsafe-fx->fl (unsafe-fxquotient 2 1)))
|
||||
(unboxed-gensym-2 1.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-6 (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2)
|
||||
unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-float-1 (unsafe-fx->fl (unsafe-fxquotient 2 1)))
|
||||
(unboxed-real-2 1.0)
|
||||
(unboxed-imag-3 2.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-6 (unsafe-fl+ (unsafe-fl+ unboxed-float-1 unboxed-real-2)
|
||||
unboxed-real-4))
|
||||
(unboxed-imag-7 (unsafe-fl+ unboxed-imag-3 unboxed-imag-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
|
|
|
@ -4,135 +4,135 @@
|
|||
(string-append (real->decimal-string (unsafe-flreal-part x) 10)
|
||||
(real->decimal-string (unsafe-flimag-part x) 10)))
|
||||
(list
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-6 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-2)
|
||||
(unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-3)))
|
||||
(unboxed-gensym-4 (unsafe-fl/ (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-2)
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-gensym-6 (unsafe-fl+ (unsafe-fl* unboxed-real-2
|
||||
unboxed-real-2)
|
||||
(unsafe-fl* unboxed-imag-3
|
||||
unboxed-imag-3)))
|
||||
(unboxed-real-4 (unsafe-fl/ (unsafe-fl* unboxed-float-1
|
||||
unboxed-real-2)
|
||||
unboxed-gensym-6))
|
||||
(unboxed-gensym-5 (unsafe-fl/ (unsafe-fl- 0.0
|
||||
(unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-imag-5 (unsafe-fl/ (unsafe-fl- 0.0
|
||||
(unsafe-fl* unboxed-float-1
|
||||
unboxed-imag-3))
|
||||
unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-5 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 (unsafe-fl/ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-5 (unsafe-fl/ unboxed-imag-2 unboxed-float-3)))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-2)
|
||||
(unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-3)))
|
||||
(unboxed-gensym-8 (unsafe-fl/ (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-2)
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-2
|
||||
unboxed-real-2)
|
||||
(unsafe-fl* unboxed-imag-3
|
||||
unboxed-imag-3)))
|
||||
(unboxed-real-8 (unsafe-fl/ (unsafe-fl* unboxed-float-1
|
||||
unboxed-real-2)
|
||||
unboxed-gensym-10))
|
||||
(unboxed-gensym-9 (unsafe-fl/ (unsafe-fl- 0.0
|
||||
(unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-imag-9 (unsafe-fl/ (unsafe-fl- 0.0
|
||||
(unsafe-fl* unboxed-float-1
|
||||
unboxed-imag-3))
|
||||
unboxed-gensym-10))
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-5
|
||||
unboxed-gensym-5)))
|
||||
(unboxed-gensym-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5))
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-4
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-5
|
||||
unboxed-imag-5)))
|
||||
(unboxed-real-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-8
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-9
|
||||
unboxed-imag-5))
|
||||
unboxed-gensym-11))
|
||||
(unboxed-gensym-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-5))
|
||||
(unboxed-imag-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-9
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-real-8
|
||||
unboxed-imag-5))
|
||||
unboxed-gensym-11)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-8 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-9 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3))
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-5
|
||||
unboxed-gensym-5)))
|
||||
(unboxed-gensym-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-8 (unsafe-fl/ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-9 (unsafe-fl/ unboxed-imag-2 unboxed-float-3))
|
||||
(unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-4
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-5
|
||||
unboxed-imag-5)))
|
||||
(unboxed-real-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-8
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-9
|
||||
unboxed-imag-5))
|
||||
unboxed-gensym-11))
|
||||
(unboxed-gensym-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-5))
|
||||
(unboxed-imag-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-9
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-real-8
|
||||
unboxed-imag-5))
|
||||
unboxed-gensym-11)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-4)))
|
||||
(unboxed-gensym-8 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-4))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-float-5 3.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-3
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-4
|
||||
unboxed-imag-4)))
|
||||
(unboxed-real-8 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-1
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-2
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-10))
|
||||
(unboxed-gensym-9 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-4))
|
||||
(unboxed-imag-9 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-2
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-real-1
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-10))
|
||||
(unboxed-gensym-6 (unsafe-fl/ unboxed-gensym-8
|
||||
unboxed-gensym-5))
|
||||
(unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-9
|
||||
unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-8 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3))
|
||||
(unboxed-gensym-5 (unsafe-fl/ unboxed-gensym-7 unboxed-gensym-4))
|
||||
(unboxed-gensym-6 (unsafe-fl/ unboxed-gensym-8 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 3.0)
|
||||
(unboxed-gensym-4 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-2))
|
||||
(unboxed-gensym-8 0.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-4)))
|
||||
(unboxed-gensym-5 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-7
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4))
|
||||
(unboxed-real-6 (unsafe-fl/ unboxed-real-8
|
||||
unboxed-float-5))
|
||||
(unboxed-imag-7 (unsafe-fl/ unboxed-imag-9
|
||||
unboxed-float-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-float-4 3.0)
|
||||
(unboxed-real-7 (unsafe-fl/ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-8 (unsafe-fl/ unboxed-imag-2 unboxed-float-3))
|
||||
(unboxed-real-5 (unsafe-fl/ unboxed-real-7 unboxed-float-4))
|
||||
(unboxed-imag-6 (unsafe-fl/ unboxed-imag-8 unboxed-float-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-float-2 2.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-7 (unsafe-fl/ unboxed-float-1 unboxed-float-2))
|
||||
(unboxed-imag-8 0.0)
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-3
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-4
|
||||
unboxed-imag-4)))
|
||||
(unboxed-real-5 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-7
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-8
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-10))
|
||||
(unboxed-gensym-6 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-7
|
||||
unboxed-gensym-4))
|
||||
(unboxed-imag-6 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-8
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-real-7
|
||||
unboxed-imag-4))
|
||||
unboxed-gensym-10)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))))
|
||||
|
|
|
@ -1,85 +1,85 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-2))
|
||||
(unboxed-gensym-5 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-5 (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-8 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-2))
|
||||
(unboxed-gensym-9 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl- (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5)))
|
||||
(unboxed-gensym-7 (unsafe-fl+ (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-5))))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-8 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-9 (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl- (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5)))
|
||||
(unboxed-gensym-7 (unsafe-fl+ (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-4)
|
||||
(unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-5))))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-8 (unsafe-fl- (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-4)))
|
||||
(unboxed-gensym-9 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-4)))
|
||||
(unboxed-gensym-6 (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-5))
|
||||
(unboxed-gensym-7 (unsafe-fl* unboxed-gensym-9
|
||||
unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-7 (unsafe-fl* unboxed-gensym-1
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-8 (unsafe-fl* unboxed-gensym-2
|
||||
unboxed-gensym-3))
|
||||
(unboxed-gensym-5 (unsafe-fl* unboxed-gensym-7
|
||||
unboxed-gensym-4))
|
||||
(unboxed-gensym-6 (unsafe-fl* unboxed-gensym-8
|
||||
unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 (unsafe-fl* unboxed-float-1
|
||||
unboxed-real-2))
|
||||
(unboxed-imag-5 (unsafe-fl* unboxed-float-1
|
||||
unboxed-imag-3)))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 (unsafe-fl* unboxed-real-1
|
||||
unboxed-float-3))
|
||||
(unboxed-imag-5 (unsafe-fl* unboxed-imag-2
|
||||
unboxed-float-3)))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-8 (unsafe-fl* unboxed-float-1
|
||||
unboxed-real-2))
|
||||
(unboxed-imag-9 (unsafe-fl* unboxed-float-1
|
||||
unboxed-imag-3))
|
||||
(unboxed-real-6 (unsafe-fl- (unsafe-fl* unboxed-real-8
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-9
|
||||
unboxed-imag-5)))
|
||||
(unboxed-imag-7 (unsafe-fl+ (unsafe-fl* unboxed-imag-9
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-real-8
|
||||
unboxed-imag-5))))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-8 (unsafe-fl* unboxed-real-1
|
||||
unboxed-float-3))
|
||||
(unboxed-imag-9 (unsafe-fl* unboxed-imag-2
|
||||
unboxed-float-3))
|
||||
(unboxed-real-6 (unsafe-fl- (unsafe-fl* unboxed-real-8
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-imag-9
|
||||
unboxed-imag-5)))
|
||||
(unboxed-imag-7 (unsafe-fl+ (unsafe-fl* unboxed-imag-9
|
||||
unboxed-real-4)
|
||||
(unsafe-fl* unboxed-real-8
|
||||
unboxed-imag-5))))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-float-5 3.0)
|
||||
(unboxed-real-8 (unsafe-fl- (unsafe-fl* unboxed-real-1
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
(unboxed-imag-9 (unsafe-fl+ (unsafe-fl* unboxed-imag-2
|
||||
unboxed-real-3)
|
||||
(unsafe-fl* unboxed-real-1
|
||||
unboxed-imag-4)))
|
||||
(unboxed-real-6 (unsafe-fl* unboxed-real-8
|
||||
unboxed-float-5))
|
||||
(unboxed-imag-7 (unsafe-fl* unboxed-imag-9
|
||||
unboxed-float-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-float-4 3.0)
|
||||
(unboxed-real-7 (unsafe-fl* unboxed-real-1
|
||||
unboxed-float-3))
|
||||
(unboxed-imag-8 (unsafe-fl* unboxed-imag-2
|
||||
unboxed-float-3))
|
||||
(unboxed-real-5 (unsafe-fl* unboxed-real-7
|
||||
unboxed-float-4))
|
||||
(unboxed-imag-6 (unsafe-fl* unboxed-imag-8
|
||||
unboxed-float-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
|
|
|
@ -1,35 +1,32 @@
|
|||
#lang typed/scheme #:optimize
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 3.0)
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-5 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2))
|
||||
(unboxed-gensym-5 unboxed-gensym-3))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 3.0)
|
||||
(unboxed-gensym-4 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-5 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-2))
|
||||
(unboxed-gensym-5 (unsafe-fl- 0.0 unboxed-gensym-3)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 1.0)
|
||||
(unboxed-gensym-4 2.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-4))
|
||||
(unboxed-gensym-6 0.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 3.0)
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-5 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2))
|
||||
(unboxed-imag-5 unboxed-imag-3))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 3.0)
|
||||
(unboxed-real-4 (unsafe-fl- unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-5 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 (unsafe-fl- unboxed-float-1 unboxed-real-2))
|
||||
(unboxed-imag-5 (unsafe-fl- 0.0 unboxed-imag-3)))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 (unsafe-fl+ 1.0 2.0))
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
(unboxed-imag-5 unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
#lang typed/scheme #:optimize
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-6 (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-2
|
||||
unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1
|
||||
unboxed-gensym-2)
|
||||
unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl- (unsafe-fl- 0.0
|
||||
unboxed-gensym-3)
|
||||
unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 6.0)
|
||||
(unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl- unboxed-gensym-2
|
||||
unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
unboxed-gensym-5))
|
||||
(unboxed-gensym-7 (unsafe-fl- unboxed-gensym-2
|
||||
unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-6 (unsafe-fl+ (unsafe-fl+ unboxed-real-1
|
||||
unboxed-float-3)
|
||||
unboxed-real-4))
|
||||
(unboxed-imag-7 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-float-1 1.0)
|
||||
(unboxed-real-2 2.0)
|
||||
(unboxed-imag-3 4.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-float-1
|
||||
unboxed-real-2)
|
||||
unboxed-real-4))
|
||||
(unboxed-imag-7 (unsafe-fl- (unsafe-fl- 0.0
|
||||
unboxed-imag-3)
|
||||
unboxed-imag-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-3 2.0)
|
||||
(unboxed-real-4 3.0)
|
||||
(unboxed-imag-5 6.0)
|
||||
(unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-real-1
|
||||
unboxed-float-3)
|
||||
unboxed-real-4))
|
||||
(unboxed-imag-7 (unsafe-fl- unboxed-imag-2
|
||||
unboxed-imag-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-float-5 3.0)
|
||||
(unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-real-1
|
||||
unboxed-real-3)
|
||||
unboxed-float-5))
|
||||
(unboxed-imag-7 (unsafe-fl- unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 0.0)
|
||||
(unboxed-gensym-4 1.0)
|
||||
(unboxed-gensym-5 2.0)
|
||||
(unboxed-gensym-6 4.0)
|
||||
(unboxed-gensym-7 (unsafe-fl- (unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-6)))
|
||||
(unboxed-gensym-8 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4
|
||||
unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-3
|
||||
unboxed-gensym-6)))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 0.0)
|
||||
(unboxed-imag-4 1.0)
|
||||
(unboxed-real-5 2.0)
|
||||
(unboxed-imag-6 4.0)
|
||||
(unboxed-real-7 (unsafe-fl- (unsafe-fl* unboxed-real-3
|
||||
unboxed-real-5)
|
||||
(unsafe-fl* unboxed-imag-4
|
||||
unboxed-imag-6)))
|
||||
(unboxed-imag-8 (unsafe-fl+ (unsafe-fl* unboxed-imag-4
|
||||
unboxed-real-5)
|
||||
(unsafe-fl* unboxed-real-3
|
||||
unboxed-imag-6)))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
|
||||
(unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops racket/flonum)
|
||||
(let* ((unboxed-gensym-1 (->fl (expt 2 100)))
|
||||
(unboxed-gensym-2 1.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2))
|
||||
(unboxed-gensym-5 unboxed-gensym-3))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))
|
||||
(let* ((unboxed-float-1 (->fl (expt 2 100)))
|
||||
(unboxed-real-2 1.0)
|
||||
(unboxed-imag-3 2.0)
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2))
|
||||
(unboxed-imag-5 unboxed-imag-3))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
(module inexact-complex-mult typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-9 (unsafe-fl- (unsafe-fl* unboxed-gensym-1 unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2 unboxed-gensym-3)
|
||||
(unsafe-fl* unboxed-gensym-1 unboxed-gensym-4)))
|
||||
(unboxed-gensym-7 (unsafe-fl- (unsafe-fl* unboxed-gensym-9 unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-10 unboxed-gensym-6)))
|
||||
(unboxed-gensym-8 (unsafe-fl+ (unsafe-fl* unboxed-gensym-10 unboxed-gensym-5)
|
||||
(unsafe-fl* unboxed-gensym-9 unboxed-gensym-6))))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-9 (unsafe-fl- (unsafe-fl* unboxed-real-1 unboxed-real-3)
|
||||
(unsafe-fl* unboxed-imag-2 unboxed-imag-4)))
|
||||
(unboxed-imag-10 (unsafe-fl+ (unsafe-fl* unboxed-imag-2 unboxed-real-3)
|
||||
(unsafe-fl* unboxed-real-1 unboxed-imag-4)))
|
||||
(unboxed-real-7 (unsafe-fl- (unsafe-fl* unboxed-real-9 unboxed-real-5)
|
||||
(unsafe-fl* unboxed-imag-10 unboxed-imag-6)))
|
||||
(unboxed-imag-8 (unsafe-fl+ (unsafe-fl* unboxed-imag-10 unboxed-real-5)
|
||||
(unsafe-fl* unboxed-real-9 unboxed-imag-6))))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)))
|
||||
|
|
|
@ -2,31 +2,31 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
unboxed-gensym-5)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
unboxed-gensym-5)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
unboxed-gensym-6)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
unboxed-gensym-6)
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
unboxed-real-5)
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
unboxed-real-5)
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
unboxed-imag-6)
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
unboxed-imag-6)
|
||||
|
|
|
@ -2,47 +2,59 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-8))
|
||||
(unboxed-gensym-10 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-8))
|
||||
(unboxed-gensym-10 unboxed-gensym-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-real-5))
|
||||
(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)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-real-5))
|
||||
(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)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-imag-6))
|
||||
(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)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-float-1 (let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 4.0)
|
||||
(unboxed-real-3 3.0)
|
||||
(unboxed-imag-4 6.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)))
|
||||
unboxed-imag-6))
|
||||
(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))
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang typed/scheme
|
||||
(require racket/unsafe/ops)
|
||||
((lambda: ((t : Integer))
|
||||
(let* ((unboxed-gensym-1 (exact->inexact (sin (* t 6.28))))
|
||||
(unboxed-gensym-2 0.0)
|
||||
(unboxed-gensym-3 0.0)
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2))
|
||||
(unboxed-gensym-5 unboxed-gensym-3))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)))
|
||||
(let* ((unboxed-float-1 (exact->inexact (sin (* t 6.28))))
|
||||
(unboxed-real-2 0.0)
|
||||
(unboxed-imag-3 0.0)
|
||||
(unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2))
|
||||
(unboxed-imag-5 unboxed-imag-3))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)))
|
||||
1)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
(module inexact-complex typed/scheme #:optimize
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl- unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl- unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl- unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))
|
||||
(t2 (let* ((unboxed-gensym-7 3.0)
|
||||
(unboxed-gensym-8 6.0)
|
||||
(unboxed-gensym-9 4.0)
|
||||
(unboxed-gensym-10 8.0)
|
||||
(unboxed-gensym-11 (unsafe-fl+ unboxed-gensym-7 unboxed-gensym-9))
|
||||
(unboxed-gensym-12 (unsafe-fl+ unboxed-gensym-8 unboxed-gensym-10)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-11 unboxed-gensym-12)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))
|
||||
(t2 (let* ((unboxed-real-7 3.0)
|
||||
(unboxed-imag-8 6.0)
|
||||
(unboxed-real-9 4.0)
|
||||
(unboxed-imag-10 8.0)
|
||||
(unboxed-real-11 (unsafe-fl+ unboxed-real-7 unboxed-real-9))
|
||||
(unboxed-imag-12 (unsafe-fl+ unboxed-imag-8 unboxed-imag-10)))
|
||||
(unsafe-make-flrectangular unboxed-real-11 unboxed-imag-12)))
|
||||
(t3 1.0+2.0i)
|
||||
(t4 1))
|
||||
(display (let* ((unboxed-gensym-1 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-5))
|
||||
(unboxed-gensym-2 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-1 unboxed-gensym-2)))
|
||||
(display (let* ((unboxed-real-1 (unsafe-fl+ unboxed-real-5 unboxed-real-5))
|
||||
(unboxed-imag-2 (unsafe-fl+ unboxed-imag-6 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)))
|
||||
(display t2)
|
||||
(display t3)
|
||||
(display t4))
|
||||
|
|
|
@ -4,27 +4,27 @@
|
|||
|
||||
;; unboxing of let bindings does not currently work with multiple values
|
||||
(let-values (((t1 t2)
|
||||
(values (let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let* ((unboxed-gensym-1 3.0)
|
||||
(unboxed-gensym-2 6.0)
|
||||
(unboxed-gensym-3 4.0)
|
||||
(unboxed-gensym-4 8.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))))
|
||||
(values (let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(let* ((unboxed-real-1 3.0)
|
||||
(unboxed-imag-2 6.0)
|
||||
(unboxed-real-3 4.0)
|
||||
(unboxed-imag-4 8.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))))
|
||||
(let* ((unboxed-gensym-1 t1)
|
||||
(unboxed-gensym-2 (unsafe-flreal-part unboxed-gensym-1))
|
||||
(unboxed-gensym-3 (unsafe-flimag-part unboxed-gensym-1))
|
||||
(unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1))
|
||||
(unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1))
|
||||
(unboxed-gensym-4 t2)
|
||||
(unboxed-gensym-5 (unsafe-flreal-part unboxed-gensym-4))
|
||||
(unboxed-gensym-6 (unsafe-flimag-part unboxed-gensym-4))
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)))
|
||||
(unboxed-real-5 (unsafe-flreal-part unboxed-gensym-4))
|
||||
(unboxed-imag-6 (unsafe-flimag-part unboxed-gensym-4))
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-2 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-3 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)))
|
||||
(void)
|
||||
|
|
|
@ -5,23 +5,23 @@
|
|||
;; top level
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 1.0)
|
||||
((unboxed-gensym-3) (unsafe-fl* unboxed-gensym-1
|
||||
((unboxed-real-3) (unsafe-fl* unboxed-gensym-1
|
||||
(unsafe-flcos unboxed-gensym-2)))
|
||||
((unboxed-gensym-4) (unsafe-fl* unboxed-gensym-1
|
||||
((unboxed-imag-4) (unsafe-fl* unboxed-gensym-1
|
||||
(unsafe-flsin unboxed-gensym-2))))
|
||||
(unsafe-make-flrectangular unboxed-gensym-3 unboxed-gensym-4))
|
||||
(unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4))
|
||||
|
||||
;; nested
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl* unboxed-gensym-3
|
||||
((unboxed-real-5) (unsafe-fl* unboxed-gensym-3
|
||||
(unsafe-flcos unboxed-gensym-4)))
|
||||
((unboxed-gensym-6) (unsafe-fl* unboxed-gensym-3
|
||||
((unboxed-imag-6) (unsafe-fl* unboxed-gensym-3
|
||||
(unsafe-flsin unboxed-gensym-4)))
|
||||
((unboxed-gensym-7) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-5))
|
||||
((unboxed-gensym-8) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))
|
||||
((unboxed-real-7) (unsafe-fl+ unboxed-real-1 unboxed-real-5))
|
||||
((unboxed-imag-8) (unsafe-fl+ unboxed-imag-2 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))
|
||||
|
||||
(void)
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(void)
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
(module n-ary-inexact-complex typed/scheme #:optimize
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 4.0)
|
||||
(unboxed-gensym-8 8.0)
|
||||
(unboxed-gensym-9 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1
|
||||
unboxed-gensym-3)
|
||||
unboxed-gensym-5)
|
||||
unboxed-gensym-7))
|
||||
(unboxed-gensym-10 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-gensym-2
|
||||
unboxed-gensym-4)
|
||||
unboxed-gensym-6)
|
||||
unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 4.0)
|
||||
(unboxed-imag-8 8.0)
|
||||
(unboxed-real-9 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-real-1
|
||||
unboxed-real-3)
|
||||
unboxed-real-5)
|
||||
unboxed-real-7))
|
||||
(unboxed-imag-10 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-imag-2
|
||||
unboxed-imag-4)
|
||||
unboxed-imag-6)
|
||||
unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
(module nested-inexact-complex typed/scheme #:optimize
|
||||
(require racket/unsafe/ops)
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl- unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl- unboxed-gensym-4 unboxed-gensym-6))
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl- unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl- unboxed-imag-4 unboxed-imag-6))
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
|
||||
(unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 3.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(let* ((unboxed-gensym-1 2.0)
|
||||
(unboxed-gensym-2 3.0)
|
||||
(unboxed-gensym-3 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-1))
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-2))
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 3.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(let* ((unboxed-real-1 2.0)
|
||||
(unboxed-imag-2 3.0)
|
||||
(unboxed-real-3 (unsafe-fl+ unboxed-real-5 unboxed-real-1))
|
||||
(unboxed-imag-4 (unsafe-fl+ unboxed-imag-6 unboxed-imag-2))
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6)))
|
||||
(unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)))
|
||||
|
|
|
@ -12,32 +12,32 @@
|
|||
(lambda (x) #t)
|
||||
(lambda (x y) #t)))))
|
||||
(void)
|
||||
(let*-values (((unboxed-gensym-1) 0.0)
|
||||
((unboxed-gensym-2) 0.0))
|
||||
(let*-values (((unboxed-real-1) 0.0)
|
||||
((unboxed-imag-2) 0.0))
|
||||
((letrec-values
|
||||
(((for-loop)
|
||||
(lambda (unboxed-real-1 unboxed-imag-2 pos)
|
||||
(if (pos-cont? pos)
|
||||
(let*-values (((unboxed-gensym-1) (pos->vals pos))
|
||||
((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1)))
|
||||
(if (val-cont? (unsafe-make-flrectangular unboxed-gensym-2 unboxed-gensym-3))
|
||||
((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1)))
|
||||
(if (val-cont? (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(let-values (((sum)
|
||||
(let-values ()
|
||||
(let-values ()
|
||||
(let*-values (((unboxed-gensym-1) (unsafe-fl+ unboxed-gensym-2 unboxed-real-1))
|
||||
((unboxed-gensym-2) (unsafe-fl+ unboxed-gensym-3 unboxed-imag-2)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-1 unboxed-gensym-2))))))
|
||||
(if (all-cont? pos (unsafe-make-flrectangular unboxed-gensym-2 unboxed-gensym-3))
|
||||
(let*-values (((unboxed-real-1) (unsafe-fl+ unboxed-real-2 unboxed-real-1))
|
||||
((unboxed-imag-2) (unsafe-fl+ unboxed-imag-3 unboxed-imag-2)))
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2))))))
|
||||
(if (all-cont? pos (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3))
|
||||
(let*-values (((unboxed-gensym-1) sum)
|
||||
((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1)))
|
||||
(for-loop unboxed-gensym-2 unboxed-gensym-3 (pos-next pos)))
|
||||
((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1)))
|
||||
(for-loop unboxed-real-2 unboxed-imag-3 (pos-next pos)))
|
||||
sum))
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)))
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)))))
|
||||
for-loop)
|
||||
unboxed-gensym-1
|
||||
unboxed-gensym-2
|
||||
unboxed-real-1
|
||||
unboxed-imag-2
|
||||
init)))
|
||||
(void)
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
;; simple case, function with single complex arg
|
||||
(let ((f (lambda (unboxed-real-1 unboxed-imag-2)
|
||||
(let*-values (((unboxed-gensym-3) 3.0)
|
||||
((unboxed-gensym-4) 6.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))))
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(f unboxed-gensym-5 unboxed-gensym-6)))
|
||||
(let*-values (((unboxed-real-3) 3.0)
|
||||
((unboxed-imag-4) 6.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(f unboxed-real-5 unboxed-imag-6)))
|
||||
(void)
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
;; function with multiple complex args
|
||||
(let ((f (lambda (unboxed-real-1 unboxed-real-2 unboxed-imag-3 unboxed-imag-4)
|
||||
(let*-values (((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-real-2))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-3 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))))
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))
|
||||
((unboxed-gensym-7) 3.0)
|
||||
((unboxed-gensym-8) 6.0))
|
||||
(f unboxed-gensym-5 unboxed-gensym-7 unboxed-gensym-6 unboxed-gensym-8)))
|
||||
(let*-values (((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-2))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-3 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))
|
||||
((unboxed-real-7) 3.0)
|
||||
((unboxed-imag-8) 6.0))
|
||||
(f unboxed-real-5 unboxed-real-7 unboxed-imag-6 unboxed-imag-8)))
|
||||
(void)
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
;; function with a mix of complex and non-complex args
|
||||
(let ((f (lambda (unboxed-real-1 unboxed-imag-2 y)
|
||||
(let*-values (((unboxed-gensym-3) y)
|
||||
((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-5) unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)))))
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(f unboxed-gensym-5 unboxed-gensym-6 3.0)))
|
||||
(let*-values (((unboxed-float-3) y)
|
||||
((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
((unboxed-imag-5) unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)))))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(f unboxed-real-5 unboxed-imag-6 3.0)))
|
||||
(void)
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
;; function with a mix of complex and non-complex args
|
||||
(let ((f (lambda (unboxed-real-1 unboxed-imag-2 y)
|
||||
(let*-values (((unboxed-gensym-3) y)
|
||||
((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-5) unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)))))
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(f unboxed-gensym-5 unboxed-gensym-6 3.0)))
|
||||
(let*-values (((unboxed-float-3) y)
|
||||
((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
((unboxed-imag-5) unboxed-imag-2))
|
||||
(unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)))))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(f unboxed-real-5 unboxed-imag-6 3.0)))
|
||||
(void)
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
(letrec ((f (lambda (x)
|
||||
(let ((y f))
|
||||
x))))
|
||||
(f (let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))))
|
||||
(f (let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))))
|
||||
(void)
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
(require racket/unsafe/ops racket/flonum)
|
||||
|
||||
(let*-values (((unboxed-gensym-1) 0.0)
|
||||
((unboxed-gensym-2) 0.0))
|
||||
(let*-values (((unboxed-real-1) 0.0)
|
||||
((unboxed-imag-2) 0.0))
|
||||
((letrec-values
|
||||
(((loop)
|
||||
(lambda (unboxed-real-1 unboxed-imag-2 l)
|
||||
(if (null? l)
|
||||
(let*-values (((unboxed-gensym-3) 0.0)
|
||||
((unboxed-gensym-4) 1.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let*-values (((unboxed-gensym-1) (->fl (unsafe-car l)))
|
||||
((unboxed-gensym-2) (unsafe-fl+ unboxed-real-1 unboxed-gensym-1))
|
||||
((unboxed-gensym-3) unboxed-imag-2))
|
||||
(loop unboxed-gensym-2 unboxed-gensym-3
|
||||
(let*-values (((unboxed-real-3) 0.0)
|
||||
((unboxed-imag-4) 1.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(let*-values (((unboxed-float-1) (->fl (unsafe-car l)))
|
||||
((unboxed-real-2) (unsafe-fl+ unboxed-real-1 unboxed-float-1))
|
||||
((unboxed-imag-3) unboxed-imag-2))
|
||||
(loop unboxed-real-2 unboxed-imag-3
|
||||
(unsafe-cdr l)))))))
|
||||
loop)
|
||||
unboxed-gensym-1 unboxed-gensym-2 '(1 2 3)))
|
||||
unboxed-real-1 unboxed-imag-2 '(1 2 3)))
|
||||
(void)
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
|
||||
(require racket/unsafe/ops racket/flonum)
|
||||
|
||||
(let*-values (((unboxed-gensym-1) 0.0)
|
||||
((unboxed-gensym-2) 0.0))
|
||||
(let*-values (((unboxed-real-1) 0.0)
|
||||
((unboxed-imag-2) 0.0))
|
||||
((letrec-values
|
||||
(((loop)
|
||||
(lambda (unboxed-real-1 unboxed-imag-2 l)
|
||||
(if (null? l)
|
||||
(unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)
|
||||
(let*-values (((unboxed-gensym-3) (->fl (unsafe-car l)))
|
||||
((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-5) unboxed-imag-2))
|
||||
(loop unboxed-gensym-4 unboxed-gensym-5
|
||||
(let*-values (((unboxed-float-3) (->fl (unsafe-car l)))
|
||||
((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3))
|
||||
((unboxed-imag-5) unboxed-imag-2))
|
||||
(loop unboxed-real-4 unboxed-imag-5
|
||||
(unsafe-cdr l)))))))
|
||||
loop)
|
||||
unboxed-gensym-1 unboxed-gensym-2 '(1 2 3)))
|
||||
unboxed-real-1 unboxed-imag-2 '(1 2 3)))
|
||||
(void)
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(letrec-values (((f) (lambda (x)
|
||||
(letrec-values
|
||||
(((f) (lambda (x)
|
||||
(let*-values (((unboxed-gensym-1) x)
|
||||
((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1))
|
||||
((unboxed-gensym-4) 2.0)
|
||||
((unboxed-gensym-5) 4.0)
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))
|
||||
((unboxed-gensym-7) (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7))))
|
||||
((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1))
|
||||
((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1))
|
||||
((unboxed-real-4) 2.0)
|
||||
((unboxed-imag-5) 4.0)
|
||||
((unboxed-real-6) (unsafe-fl+ unboxed-real-2 unboxed-real-4))
|
||||
((unboxed-imag-7) (unsafe-fl+ unboxed-imag-3 unboxed-imag-5)))
|
||||
(unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7))))
|
||||
((g) f))
|
||||
(f 1.0+2.0i))
|
||||
(void)
|
||||
|
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) ; t1-real
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) ; t1-imag
|
||||
(let* ((unboxed-gensym-1 3.0)
|
||||
(unboxed-gensym-2 6.0)
|
||||
(unboxed-gensym-3 (unsafe-fl- unboxed-gensym-5 unboxed-gensym-1)) ; t2-real
|
||||
(unboxed-gensym-4 (unsafe-fl- unboxed-gensym-6 unboxed-gensym-2))) ; t2-imag
|
||||
(let* ((unboxed-gensym-1 4.0) ; t3-real
|
||||
(unboxed-gensym-2 8.0) ; t3-imag
|
||||
(unboxed-gensym-3 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-1))
|
||||
(unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-2)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-3 unboxed-gensym-4))))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) ; t1-real
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) ; t1-imag
|
||||
(let* ((unboxed-real-1 3.0)
|
||||
(unboxed-imag-2 6.0)
|
||||
(unboxed-real-3 (unsafe-fl- unboxed-real-5 unboxed-real-1)) ; t2-real
|
||||
(unboxed-imag-4 (unsafe-fl- unboxed-imag-6 unboxed-imag-2))) ; t2-imag
|
||||
(let* ((unboxed-real-1 4.0) ; t3-real
|
||||
(unboxed-imag-2 8.0) ; t3-imag
|
||||
(unboxed-real-3 (unsafe-fl+ unboxed-real-3 unboxed-real-1))
|
||||
(unboxed-imag-4 (unsafe-fl+ unboxed-imag-4 unboxed-imag-2)))
|
||||
(unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4))))
|
||||
(void)
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let* ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
(unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))
|
||||
(unboxed-gensym-7 3.0)
|
||||
(unboxed-gensym-8 6.0)
|
||||
(unboxed-gensym-9 4.0)
|
||||
(unboxed-gensym-10 8.0)
|
||||
(unboxed-gensym-11 (unsafe-fl+ unboxed-gensym-7 unboxed-gensym-9))
|
||||
(unboxed-gensym-12 (unsafe-fl+ unboxed-gensym-8 unboxed-gensym-10))
|
||||
(unboxed-gensym-13 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-11))
|
||||
(unboxed-gensym-14 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-12)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-13 unboxed-gensym-14))
|
||||
(let* ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
(unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))
|
||||
(unboxed-real-7 3.0)
|
||||
(unboxed-imag-8 6.0)
|
||||
(unboxed-real-9 4.0)
|
||||
(unboxed-imag-10 8.0)
|
||||
(unboxed-real-11 (unsafe-fl+ unboxed-real-7 unboxed-real-9))
|
||||
(unboxed-imag-12 (unsafe-fl+ unboxed-imag-8 unboxed-imag-10))
|
||||
(unboxed-real-13 (unsafe-fl+ unboxed-real-5 unboxed-real-11))
|
||||
(unboxed-imag-14 (unsafe-fl+ unboxed-imag-6 unboxed-imag-12)))
|
||||
(unsafe-make-flrectangular unboxed-real-13 unboxed-imag-14))
|
||||
|
|
|
@ -9,17 +9,17 @@
|
|||
;; by comparison, cases where we leave a result unboxed and box it
|
||||
;; if needed (like here) or cases where this would unbox loop variables
|
||||
;; are likely to be more common, and more interesting
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(if (even? 2)
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)
|
||||
(let*-values (((unboxed-gensym-7) 2.0)
|
||||
((unboxed-gensym-8) 4.0)
|
||||
((unboxed-gensym-9) (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-7))
|
||||
((unboxed-gensym-10) (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)
|
||||
(let*-values (((unboxed-real-7) 2.0)
|
||||
((unboxed-imag-8) 4.0)
|
||||
((unboxed-real-9) (unsafe-fl+ unboxed-real-5 unboxed-real-7))
|
||||
((unboxed-imag-10) (unsafe-fl+ unboxed-imag-6 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))))
|
||||
(void)
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
(letrec-syntaxes+values
|
||||
(((s) (syntax-rules () [(_ x) x])))
|
||||
(((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(let* ((unboxed-gensym-7 2.0)
|
||||
(unboxed-gensym-8 4.0)
|
||||
(unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)))
|
||||
(((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(let* ((unboxed-real-7 2.0)
|
||||
(unboxed-imag-8 4.0)
|
||||
(unboxed-real-9 (unsafe-fl+ unboxed-real-5 unboxed-real-7))
|
||||
(unboxed-imag-10 (unsafe-fl+ unboxed-imag-6 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))
|
||||
(void)
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(letrec ((unboxed-gensym-1 1.0)
|
||||
(unboxed-gensym-2 2.0)
|
||||
(unboxed-gensym-3 2.0)
|
||||
(unboxed-gensym-4 4.0)
|
||||
(unboxed-gensym-5 3.0)
|
||||
(unboxed-gensym-6 6.0)
|
||||
(unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))
|
||||
(unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))
|
||||
(letrec ((unboxed-real-1 1.0)
|
||||
(unboxed-imag-2 2.0)
|
||||
(unboxed-real-3 2.0)
|
||||
(unboxed-imag-4 4.0)
|
||||
(unboxed-real-5 3.0)
|
||||
(unboxed-imag-6 6.0)
|
||||
(unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5))
|
||||
(unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))
|
||||
(f (lambda (x) (f x))))
|
||||
(let* ((unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7))
|
||||
(unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)))
|
||||
(let* ((unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7))
|
||||
(unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8)))
|
||||
(unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))
|
||||
(void)
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let*-values (((unboxed-gensym-1) 1.0)
|
||||
((unboxed-gensym-2) 2.0)
|
||||
((unboxed-gensym-3) 2.0)
|
||||
((unboxed-gensym-4) 4.0)
|
||||
((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3))
|
||||
((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)))
|
||||
(unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(let*-values (((unboxed-real-1) 1.0)
|
||||
((unboxed-imag-2) 2.0)
|
||||
((unboxed-real-3) 2.0)
|
||||
((unboxed-imag-4) 4.0)
|
||||
((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3))
|
||||
((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)))
|
||||
(unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))
|
||||
(void)
|
||||
|
|
|
@ -32,12 +32,19 @@
|
|||
;; complex operations
|
||||
(define-syntax-class unboxed-inexact-complex-opt-expr
|
||||
|
||||
;; special handling of reals inside complex operations
|
||||
(pattern e:float-coerce-expr
|
||||
#:with real-binding (unboxed-gensym 'unboxed-float-)
|
||||
#:with imag-binding #f
|
||||
#:with (bindings ...)
|
||||
#`(((real-binding) e.opt)))
|
||||
|
||||
(pattern (#%plain-app (~and op (~literal +))
|
||||
c1:unboxed-inexact-complex-opt-expr
|
||||
c2:unboxed-inexact-complex-opt-expr
|
||||
cs:unboxed-inexact-complex-opt-expr ...)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "unboxed binary inexact complex" #'op)
|
||||
#`(#,@(append (syntax->list #'(c1.bindings ... c2.bindings ... cs.bindings ... ...))
|
||||
|
@ -60,8 +67,8 @@
|
|||
c1:unboxed-inexact-complex-opt-expr
|
||||
c2:unboxed-inexact-complex-opt-expr
|
||||
cs:unboxed-inexact-complex-opt-expr ...)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "unboxed binary inexact complex" #'op)
|
||||
#`(#,@(append (syntax->list #'(c1.bindings ... c2.bindings ... cs.bindings ... ...))
|
||||
|
@ -87,8 +94,8 @@
|
|||
c1:unboxed-inexact-complex-opt-expr
|
||||
c2:unboxed-inexact-complex-opt-expr
|
||||
cs:unboxed-inexact-complex-opt-expr ...)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "unboxed binary inexact complex" #'op)
|
||||
#`(c1.bindings ... c2.bindings ... cs.bindings ... ...
|
||||
|
@ -102,10 +109,10 @@
|
|||
[o2 (car li)]
|
||||
[e1 (cdr lr)]
|
||||
[e2 (cdr li)]
|
||||
[rs (append (map (lambda (x) (unboxed-gensym))
|
||||
[rs (append (map (lambda (x) (unboxed-gensym "unboxed-real-"))
|
||||
(syntax->list #'(cs.real-binding ...)))
|
||||
(list #'real-binding))]
|
||||
[is (append (map (lambda (x) (unboxed-gensym))
|
||||
[is (append (map (lambda (x) (unboxed-gensym "unboxed-imag-"))
|
||||
(syntax->list #'(cs.imag-binding ...)))
|
||||
(list #'imag-binding))]
|
||||
[res '()])
|
||||
|
@ -135,8 +142,8 @@
|
|||
c1:unboxed-inexact-complex-opt-expr
|
||||
c2:unboxed-inexact-complex-opt-expr
|
||||
cs:unboxed-inexact-complex-opt-expr ...)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with reals (map (lambda (x) (if (syntax->datum x) x #'0.0))
|
||||
(syntax->list #'(c1.real-binding c2.real-binding cs.real-binding ...)))
|
||||
#:with imags (map (lambda (x) (if (syntax->datum x) x #'0.0))
|
||||
|
@ -150,10 +157,10 @@
|
|||
[o2 (car (syntax->list #'imags))]
|
||||
[e1 (cdr (syntax->list #'reals))]
|
||||
[e2 (cdr (syntax->list #'imags))]
|
||||
[rs (append (map (lambda (x) (unboxed-gensym))
|
||||
[rs (append (map (lambda (x) (unboxed-gensym "unboxed-real-"))
|
||||
(syntax->list #'(cs.real-binding ...)))
|
||||
(list #'real-binding))]
|
||||
[is (append (map (lambda (x) (unboxed-gensym))
|
||||
[is (append (map (lambda (x) (unboxed-gensym "unboxed-imag-"))
|
||||
(syntax->list #'(cs.imag-binding ...)))
|
||||
(list #'imag-binding))]
|
||||
[ds (map (lambda (x) (unboxed-gensym))
|
||||
|
@ -203,7 +210,7 @@
|
|||
|
||||
(pattern (#%plain-app (~and op (~literal conjugate)) c:unboxed-inexact-complex-opt-expr)
|
||||
#:with real-binding #'c.real-binding
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "unboxed unary inexact complex" #'op)
|
||||
#`(#,@(append (syntax->list #'(c.bindings ...))
|
||||
|
@ -228,8 +235,8 @@
|
|||
(pattern (#%plain-app (~and op (~or (~literal make-rectangular)
|
||||
(~literal unsafe-make-flrectangular)))
|
||||
real:float-coerce-expr imag:float-coerce-expr)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "make-rectangular elimination" #'op)
|
||||
#'(((real-binding) real.opt)
|
||||
|
@ -238,8 +245,8 @@
|
|||
r:float-coerce-expr theta:float-coerce-expr)
|
||||
#:with magnitude (unboxed-gensym)
|
||||
#:with angle (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(begin (log-optimization "make-rectangular elimination" #'op)
|
||||
#'(((magnitude) r.opt)
|
||||
|
@ -262,8 +269,8 @@
|
|||
#:when (let ((x (syntax->datum #'n)))
|
||||
(and (number? x)
|
||||
(not (eq? (imag-part x) 0))))
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
(let ((n (syntax->datum #'n)))
|
||||
#`(((real-binding) #,(datum->syntax
|
||||
|
@ -274,7 +281,7 @@
|
|||
(exact->inexact (imag-part n)))))))
|
||||
(pattern (quote n)
|
||||
#:when (real? (syntax->datum #'n))
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding #f
|
||||
#:with (bindings ...)
|
||||
#`(((real-binding) #,(datum->syntax
|
||||
|
@ -284,23 +291,17 @@
|
|||
(pattern e:expr
|
||||
#:when (isoftype? #'e -InexactComplex)
|
||||
#:with e* (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
#`(((e*) #,((optimize) #'e))
|
||||
((real-binding) (unsafe-flreal-part e*))
|
||||
((imag-binding) (unsafe-flimag-part e*))))
|
||||
;; special handling of reals
|
||||
(pattern e:float-coerce-expr
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding #f
|
||||
#:with (bindings ...)
|
||||
#`(((real-binding) e.opt)))
|
||||
(pattern e:expr
|
||||
#:when (isoftype? #'e -Number) ; complex, maybe exact, maybe not
|
||||
#:with e* (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym)
|
||||
#:with imag-binding (unboxed-gensym)
|
||||
#:with real-binding (unboxed-gensym "unboxed-real-")
|
||||
#:with imag-binding (unboxed-gensym "unboxed-imag-")
|
||||
#:with (bindings ...)
|
||||
#`(((e*) #,((optimize) #'e))
|
||||
((real-binding) (exact->inexact (real-part e*)))
|
||||
|
|
|
@ -271,9 +271,9 @@
|
|||
#:when (syntax->datum #'unboxed-info)
|
||||
;; partition of the arguments
|
||||
#:with ((to-unbox ...) (boxed ...)) #'unboxed-info
|
||||
#:with (real-params ...) (map (lambda (x) (unboxed-gensym 'unboxed-real-))
|
||||
#:with (real-params ...) (map (lambda (x) (unboxed-gensym "unboxed-real-"))
|
||||
(syntax->list #'(to-unbox ...)))
|
||||
#:with (imag-params ...) (map (lambda (x) (unboxed-gensym 'unboxed-imag-))
|
||||
#:with (imag-params ...) (map (lambda (x) (unboxed-gensym "unboxed-imag-"))
|
||||
(syntax->list #'(to-unbox ...)))
|
||||
#:with res
|
||||
(begin
|
||||
|
|
Loading…
Reference in New Issue
Block a user