/[gcl]/gcl/ansi-tests/divide.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/divide.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pfdietz, Fri Sep 5 03:18:53 2003 UTC revision 1.4 by pfdietz, Fri Sep 5 12:38:03 2003 UTC
# Line 96  Line 96 
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
# Line 112  Line 107 
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)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26