1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
3 ;;; "f2cl2.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
4 ;;; "f2cl3.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
5 ;;; "f2cl4.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
6 ;;; "f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v fceac530ef0c 2011/11/26 04:02:26 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2012-04 (20C Unicode)
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':simple-array)
14 ;;; (:array-slicing nil) (:declare-common nil)
15 ;;; (:float-format double-float))
20 (let ((zeror 0.0) (zeroi 0.0) (coner 1.0) (conei 0.0))
21 (declare (type (double-float) zeror zeroi coner conei
))
22 (defun zseri (zr zi fnu kode n yr yi nz tol elim alim
)
23 (declare (type (simple-array double-float
(*)) yi yr
)
24 (type (f2cl-lib:integer4
) nz n kode
)
25 (type (double-float) alim elim tol fnu zi zr
))
26 (prog ((wr (make-array 2 :element-type
'double-float
))
27 (wi (make-array 2 :element-type
'double-float
)) (i 0) (ib 0)
28 (idum 0) (iflag 0) (il 0) (k 0) (l 0) (m 0) (nn 0) (nw 0) (aa 0.0)
29 (acz 0.0) (ak 0.0) (ak1i 0.0) (ak1r 0.0) (arm 0.0) (ascle 0.0)
30 (atol 0.0) (az 0.0) (cki 0.0) (ckr 0.0) (coefi 0.0) (coefr 0.0)
31 (crscr 0.0) (czi 0.0) (czr 0.0) (dfnu 0.0) (fnup 0.0) (hzi 0.0)
32 (hzr 0.0) (raz 0.0) (rs 0.0) (rtr1 0.0) (rzi 0.0) (rzr 0.0) (s 0.0)
33 (ss 0.0) (sti 0.0) (str 0.0) (s1i 0.0) (s1r 0.0) (s2i 0.0)
35 (declare (type (simple-array double-float
(2)) wr wi
)
36 (type (double-float) s2r s2i s1r s1i str sti ss s rzr rzi rtr1
37 rs raz hzr hzi fnup dfnu czr czi crscr
38 coefr coefi ckr cki az atol ascle arm ak1r
40 (type (f2cl-lib:integer4
) nw nn m l k il iflag idum ib i
))
42 (setf az
(coerce (realpart (zabs zr zi
)) 'double-float
))
43 (if (= az
0.0) (go label160
))
44 (setf arm
(* 1000.0 (f2cl-lib:d1mach
1)))
45 (setf rtr1
(f2cl-lib:fsqrt arm
))
48 (if (< az arm
) (go label150
))
53 (if (<= az rtr1
) (go label10
))
54 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
55 (zmlt hzr hzi hzr hzi czr czi
)
56 (declare (ignore var-0 var-1 var-2 var-3
))
60 (setf acz
(coerce (realpart (zabs czr czi
)) 'double-float
))
62 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4
)
63 (zlog hzr hzi ckr cki idum
)
64 (declare (ignore var-0 var-1
))
69 (setf dfnu
(+ fnu
(f2cl-lib:int-sub nn
1)))
70 (setf fnup
(+ dfnu
1.0))
71 (setf ak1r
(* ckr dfnu
))
72 (setf ak1i
(* cki dfnu
))
74 (multiple-value-bind (ret-val var-0 var-1
)
76 (declare (ignore var-0
))
79 (setf ak1r
(- ak1r ak
))
80 (if (= kode
2) (setf ak1r
(- ak1r zr
)))
81 (if (> ak1r
(- elim
)) (go label40
))
83 (setf nz
(f2cl-lib:int-add nz
1))
84 (setf (f2cl-lib:fref yr
(nn) ((1 n
))) zeror
)
85 (setf (f2cl-lib:fref yi
(nn) ((1 n
))) zeroi
)
86 (if (> acz dfnu
) (go label190
))
87 (setf nn
(f2cl-lib:int-sub nn
1))
88 (if (= nn
0) (go end_label
))
91 (if (> ak1r
(- alim
)) (go label50
))
95 (setf ascle
(* arm ss
))
98 (if (= iflag
1) (setf aa
(* aa ss
)))
99 (setf coefr
(* aa
(cos ak1i
)))
100 (setf coefi
(* aa
(sin ak1i
)))
101 (setf atol
(/ (* tol acz
) fnup
))
102 (setf il
(min (the f2cl-lib
:integer4
2) (the f2cl-lib
:integer4 nn
)))
103 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
106 (setf dfnu
(+ fnu
(f2cl-lib:int-sub nn i
)))
107 (setf fnup
(+ dfnu
1.0))
110 (if (< acz
(* tol fnup
)) (go label70
))
113 (setf ak
(+ fnup
2.0))
118 (setf str
(- (* ak1r czr
) (* ak1i czi
)))
119 (setf sti
(+ (* ak1r czi
) (* ak1i czr
)))
120 (setf ak1r
(* str rs
))
121 (setf ak1i
(* sti rs
))
122 (setf s1r
(+ s1r ak1r
))
123 (setf s1i
(+ s1i ak1i
))
126 (setf aa
(* aa acz rs
))
127 (if (> aa atol
) (go label60
))
129 (setf s2r
(- (* s1r coefr
) (* s1i coefi
)))
130 (setf s2i
(+ (* s1r coefi
) (* s1i coefr
)))
131 (setf (f2cl-lib:fref wr
(i) ((1 2))) s2r
)
132 (setf (f2cl-lib:fref wi
(i) ((1 2))) s2i
)
133 (if (= iflag
0) (go label80
))
134 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4
)
135 (zuchk s2r s2i nw ascle tol
)
136 (declare (ignore var-0 var-1 var-3 var-4
))
138 (if (/= nw
0) (go label30
))
140 (setf m
(f2cl-lib:int-add
(f2cl-lib:int-sub nn i
) 1))
141 (setf (f2cl-lib:fref yr
(m) ((1 n
))) (* s2r crscr
))
142 (setf (f2cl-lib:fref yi
(m) ((1 n
))) (* s2i crscr
))
143 (if (= i il
) (go label90
))
144 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
145 (zdiv coefr coefi hzr hzi str sti
)
146 (declare (ignore var-0 var-1 var-2 var-3
))
149 (setf coefr
(* str dfnu
))
150 (setf coefi
(* sti dfnu
))
152 (if (<= nn
2) (go end_label
))
153 (setf k
(f2cl-lib:int-sub nn
2))
154 (setf ak
(coerce (the f2cl-lib
:integer4 k
) 'double-float
))
155 (setf raz
(/ 1.0 az
))
156 (setf str
(* zr raz
))
157 (setf sti
(* (- zi
) raz
))
158 (setf rzr
(* (+ str str
) raz
))
159 (setf rzi
(* (+ sti sti
) raz
))
160 (if (= iflag
1) (go label120
))
163 (f2cl-lib:fdo
(i ib
(f2cl-lib:int-add i
1))
166 (setf (f2cl-lib:fref yr
(k) ((1 n
)))
171 (f2cl-lib:fref yr
((f2cl-lib:int-add k
1)) ((1 n
))))
174 ((f2cl-lib:int-add k
1))
176 (f2cl-lib:fref yr
((f2cl-lib:int-add k
2)) ((1 n
)))))
177 (setf (f2cl-lib:fref yi
(k) ((1 n
)))
182 (f2cl-lib:fref yi
((f2cl-lib:int-add k
1)) ((1 n
))))
185 ((f2cl-lib:int-add k
1))
187 (f2cl-lib:fref yi
((f2cl-lib:int-add k
2)) ((1 n
)))))
189 (setf k
(f2cl-lib:int-sub k
1))
193 (setf s1r
(f2cl-lib:fref wr
(1) ((1 2))))
194 (setf s1i
(f2cl-lib:fref wi
(1) ((1 2))))
195 (setf s2r
(f2cl-lib:fref wr
(2) ((1 2))))
196 (setf s2i
(f2cl-lib:fref wi
(2) ((1 2))))
197 (f2cl-lib:fdo
(l 3 (f2cl-lib:int-add l
1))
202 (setf s2r
(+ s1r
(* (+ ak fnu
) (- (* rzr ckr
) (* rzi cki
)))))
203 (setf s2i
(+ s1i
(* (+ ak fnu
) (+ (* rzr cki
) (* rzi ckr
)))))
206 (setf ckr
(* s2r crscr
))
207 (setf cki
(* s2i crscr
))
208 (setf (f2cl-lib:fref yr
(k) ((1 n
))) ckr
)
209 (setf (f2cl-lib:fref yi
(k) ((1 n
))) cki
)
211 (setf k
(f2cl-lib:int-sub k
1))
212 (if (> (zabs ckr cki
) ascle
) (go label140
))
216 (setf ib
(f2cl-lib:int-add l
1))
217 (if (> ib nn
) (go end_label
))
221 (if (= fnu
0.0) (setf nz
(f2cl-lib:int-sub nz
1)))
223 (setf (f2cl-lib:fref yr
(1) ((1 n
))) zeror
)
224 (setf (f2cl-lib:fref yi
(1) ((1 n
))) zeroi
)
225 (if (/= fnu
0.0) (go label170
))
226 (setf (f2cl-lib:fref yr
(1) ((1 n
))) coner
)
227 (setf (f2cl-lib:fref yi
(1) ((1 n
))) conei
)
229 (if (= n
1) (go end_label
))
230 (f2cl-lib:fdo
(i 2 (f2cl-lib:int-add i
1))
233 (setf (f2cl-lib:fref yr
(i) ((1 n
))) zeror
)
234 (setf (f2cl-lib:fref yi
(i) ((1 n
))) zeroi
)
238 (setf nz
(f2cl-lib:int-sub nz
))
241 (return (values nil nil nil nil nil nil nil nz nil nil nil
)))))
243 (in-package #:cl-user
)
244 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
245 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
246 (setf (gethash 'fortran-to-lisp
::zseri fortran-to-lisp
::*f2cl-function-info
*)
247 (fortran-to-lisp::make-f2cl-finfo
248 :arg-types
'((double-float) (double-float) (double-float)
249 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
250 (simple-array double-float
(*))
251 (simple-array double-float
(*))
252 (fortran-to-lisp::integer4
) (double-float)
253 (double-float) (double-float))
254 :return-values
'(nil nil nil nil nil nil nil fortran-to-lisp
::nz nil
256 :calls
'(fortran-to-lisp::zdiv fortran-to-lisp
::zuchk
257 fortran-to-lisp
::dgamln fortran-to-lisp
::zlog
258 fortran-to-lisp
::zmlt fortran-to-lisp
::d1mach
259 fortran-to-lisp
::zabs
))))