diff --git a/ansi-tests/divide.lsp b/ansi-tests/divide.lsp index 3ee4a5677ffeec897f067926fefa1501ecefe9d3..0252718a63367da6a6c2d9b3db4510d83adf5f9b 100644 --- a/ansi-tests/divide.lsp +++ b/ansi-tests/divide.lsp @@ -96,15 +96,21 @@ collect (list i c r)) nil) +;;; 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). + (deftest /.7 (loop for bound in (list 1.0s5 1.0f10 1.0d20 1.0l20) nconc (loop for i = (1+ (random bound)) for c = (complex 0 i) for r = (/ c) - repeat 10000 - unless (eql r (complex 0 (- (/ i)))) - collect (list i c r))) + repeat 1000 + unless (= r (complex 0 (- (/ i)))) + collect (list i c r (complex 0 (- (/ i)))))) nil) (deftest /.8 diff --git a/ansi-tests/division-aux.lsp b/ansi-tests/division-aux.lsp index d129a67c375f393391bf9ab413f1b5a13e66be63..2cb3c3b4aaa1c44d18f452b5085990f6921312fd 100644 --- a/ansi-tests/division-aux.lsp +++ b/ansi-tests/division-aux.lsp @@ -10,7 +10,3 @@ (progn (apply #'/ args) (values)) (division-by-zero () (values)) (condition (c) c))) - - - - diff --git a/ansi-tests/fceiling.lsp b/ansi-tests/fceiling.lsp index b7caefd0f2295684d0b9747002d9fe500f2e96f2..b6496e2c8d9525a10a8f7900ee46f59dd835df59 100644 --- a/ansi-tests/fceiling.lsp +++ b/ansi-tests/fceiling.lsp @@ -6,7 +6,7 @@ (in-package :cl-test) (compile-and-load "numbers-aux.lsp") -(compile-and-load "fceiling-aux.lsp") +(ignore-errors (compile-and-load "fceiling-aux.lsp")) (deftest fceiling.error.1 (classify-error (fceiling)) diff --git a/ansi-tests/ffloor.lsp b/ansi-tests/ffloor.lsp index 69088467b4f2b26d39c1a323f30a75a0b454cc86..74f348db66aa56e8f51fd0a98ca7816b5ac5405b 100644 --- a/ansi-tests/ffloor.lsp +++ b/ansi-tests/ffloor.lsp @@ -6,7 +6,7 @@ (in-package :cl-test) (compile-and-load "numbers-aux.lsp") -(compile-and-load "ffloor-aux.lsp") +(ignore-errors (compile-and-load "ffloor-aux.lsp")) (deftest ffloor.error.1 (classify-error (ffloor)) diff --git a/ansi-tests/fround.lsp b/ansi-tests/fround.lsp index 1a94c6a916be44379bea1e701a8d56fa20b299a2..294393971d9dc52d3d25c8460beed3a04fcadbf1 100644 --- a/ansi-tests/fround.lsp +++ b/ansi-tests/fround.lsp @@ -6,7 +6,7 @@ (in-package :cl-test) (compile-and-load "numbers-aux.lsp") -(compile-and-load "fround-aux.lsp") +(ignore-errors (compile-and-load "fround-aux.lsp")) (deftest fround.error.1 (classify-error (fround)) diff --git a/ansi-tests/ftruncate.lsp b/ansi-tests/ftruncate.lsp index 86df3340b43d5b21a56a64017f006146204bab0b..406d994a24198a9093baa06e9a199b62ca6ab73c 100644 --- a/ansi-tests/ftruncate.lsp +++ b/ansi-tests/ftruncate.lsp @@ -6,7 +6,7 @@ (in-package :cl-test) (compile-and-load "numbers-aux.lsp") -(compile-and-load "ftruncate-aux.lsp") +(ignore-errors (compile-and-load "ftruncate-aux.lsp")) (deftest ftruncate.error.1 (classify-error (ftruncate))