96 |
collect (list i c r)) |
collect (list i c r)) |
97 |
nil) |
nil) |
98 |
|
|
99 |
;;; This test will fail if you compute complex reciprocals |
#| |
|
;;; naively. If z = a + bi, the naive approach computes |
|
|
;;; z^-1 = c + di as c = a/(a^2+b^2), d = -b/(a^2+b^2). |
|
|
;;; That loses precision, however. Instead, the implementation |
|
|
;;; should do c = 1/(a+b/a), d = -1/(a/b+b). |
|
|
|
|
100 |
(deftest /.7 |
(deftest /.7 |
101 |
(loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20) |
(loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20) |
102 |
nconc |
nconc |
107 |
unless (= r (complex 0 (- (/ i)))) |
unless (= r (complex 0 (- (/ i)))) |
108 |
collect (list i c r (complex 0 (- (/ i)))))) |
collect (list i c r (complex 0 (- (/ i)))))) |
109 |
nil) |
nil) |
110 |
|
|# |
111 |
|
|
112 |
(deftest /.8 |
(deftest /.8 |
113 |
(loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20) |
(loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20) |