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 ((pi$
3.141592653589793) (zeror 0.0) (coner 1.0))
21 (declare (type (double-float) pi$ zeror coner
))
22 (defun zacon (zr zi fnu kode mr n yr yi nz rl fnul tol elim alim
)
23 (declare (type (simple-array double-float
(*)) yi yr
)
24 (type (f2cl-lib:integer4
) nz n mr kode
)
25 (type (double-float) alim elim tol fnul rl fnu zi zr
))
26 (prog ((cyr (make-array 2 :element-type
'double-float
))
27 (cyi (make-array 2 :element-type
'double-float
))
28 (cssr (make-array 3 :element-type
'double-float
))
29 (csrr (make-array 3 :element-type
'double-float
))
30 (bry (make-array 3 :element-type
'double-float
)) (i 0) (inu 0)
31 (iuf 0) (kflag 0) (nn 0) (nw 0) (arg 0.0) (ascle 0.0) (as2 0.0)
32 (azn 0.0) (bscle 0.0) (cki 0.0) (ckr 0.0) (cpn 0.0) (cscl 0.0)
33 (cscr 0.0) (csgni 0.0) (csgnr 0.0) (cspni 0.0) (cspnr 0.0) (csr 0.0)
34 (c1i 0.0) (c1m 0.0) (c1r 0.0) (c2i 0.0) (c2r 0.0) (fmr 0.0) (fn 0.0)
35 (pti 0.0) (ptr 0.0) (razn 0.0) (rzi 0.0) (rzr 0.0) (sc1i 0.0)
36 (sc1r 0.0) (sc2i 0.0) (sc2r 0.0) (sgn 0.0) (spn 0.0) (sti 0.0)
37 (str 0.0) (s1i 0.0) (s1r 0.0) (s2i 0.0) (s2r 0.0) (yy 0.0) (zni 0.0)
39 (declare (type (simple-array double-float
(2)) cyr cyi
)
40 (type (simple-array double-float
(3)) cssr csrr bry
)
41 (type (double-float) znr zni yy s2r s2i s1r s1i str sti spn sgn
42 sc2r sc2i sc1r sc1i rzr rzi razn ptr pti fn
43 fmr c2r c2i c1r c1m c1i csr cspnr cspni
44 csgnr csgni cscr cscl cpn ckr cki bscle azn
46 (type (f2cl-lib:integer4
) nw nn kflag iuf inu i
))
52 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9 var-10
54 (zbinu znr zni fnu kode nn yr yi nw rl fnul tol elim alim
)
55 (declare (ignore var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-8 var-9
56 var-10 var-11 var-12
))
58 (if (< nw
0) (go label90
))
59 (setf nn
(min (the f2cl-lib
:integer4
2) (the f2cl-lib
:integer4 n
)))
61 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
63 (zbknu znr zni fnu kode nn cyr cyi nw tol elim alim
)
64 (declare (ignore var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-8 var-9
67 (if (/= nw
0) (go label90
))
68 (setf s1r
(f2cl-lib:fref cyr
(1) ((1 2))))
69 (setf s1i
(f2cl-lib:fref cyi
(1) ((1 2))))
70 (setf fmr
(coerce (the f2cl-lib
:integer4 mr
) 'double-float
))
71 (setf sgn
(coerce (- (f2cl-lib:dsign pi$ fmr
)) 'double-float
))
74 (if (= kode
1) (go label10
))
78 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
79 (zmlt csgnr csgni cpn spn csgnr csgni
)
80 (declare (ignore var-0 var-1 var-2 var-3
))
84 (setf inu
(f2cl-lib:int fnu
))
85 (setf arg
(* (- fnu inu
) sgn
))
90 (if (= (mod inu
2) 0) (go label20
))
91 (setf cspnr
(- cspnr
))
92 (setf cspni
(- cspni
))
97 (setf c2r
(f2cl-lib:fref yr
(1) ((1 n
))))
98 (setf c2i
(f2cl-lib:fref yi
(1) ((1 n
))))
99 (setf ascle
(/ (* 1000.0 (f2cl-lib:d1mach
1)) tol
))
100 (if (= kode
1) (go label30
))
102 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
)
103 (zs1s2 znr zni c1r c1i c2r c2i nw ascle alim iuf
)
104 (declare (ignore var-0 var-1 var-7 var-8
))
111 (setf nz
(f2cl-lib:int-add nz nw
))
115 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
116 (zmlt cspnr cspni c1r c1i str sti
)
117 (declare (ignore var-0 var-1 var-2 var-3
))
120 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
121 (zmlt csgnr csgni c2r c2i ptr pti
)
122 (declare (ignore var-0 var-1 var-2 var-3
))
125 (setf (f2cl-lib:fref yr
(1) ((1 n
))) (+ str ptr
))
126 (setf (f2cl-lib:fref yi
(1) ((1 n
))) (+ sti pti
))
127 (if (= n
1) (go end_label
))
128 (setf cspnr
(- cspnr
))
129 (setf cspni
(- cspni
))
130 (setf s2r
(f2cl-lib:fref cyr
(2) ((1 2))))
131 (setf s2i
(f2cl-lib:fref cyi
(2) ((1 2))))
134 (setf c2r
(f2cl-lib:fref yr
(2) ((1 n
))))
135 (setf c2i
(f2cl-lib:fref yi
(2) ((1 n
))))
136 (if (= kode
1) (go label40
))
138 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
)
139 (zs1s2 znr zni c1r c1i c2r c2i nw ascle alim iuf
)
140 (declare (ignore var-0 var-1 var-7 var-8
))
147 (setf nz
(f2cl-lib:int-add nz nw
))
151 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
152 (zmlt cspnr cspni c1r c1i str sti
)
153 (declare (ignore var-0 var-1 var-2 var-3
))
156 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
157 (zmlt csgnr csgni c2r c2i ptr pti
)
158 (declare (ignore var-0 var-1 var-2 var-3
))
161 (setf (f2cl-lib:fref yr
(2) ((1 n
))) (+ str ptr
))
162 (setf (f2cl-lib:fref yi
(2) ((1 n
))) (+ sti pti
))
163 (if (= n
2) (go end_label
))
164 (setf cspnr
(- cspnr
))
165 (setf cspni
(- cspni
))
166 (setf azn
(coerce (realpart (zabs znr zni
)) 'double-float
))
167 (setf razn
(/ 1.0 azn
))
168 (setf str
(* znr razn
))
169 (setf sti
(* (- zni
) razn
))
170 (setf rzr
(* (+ str str
) razn
))
171 (setf rzi
(* (+ sti sti
) razn
))
172 (setf fn
(+ fnu
1.0))
173 (setf ckr
(* fn rzr
))
174 (setf cki
(* fn rzi
))
175 (setf cscl
(/ 1.0 tol
))
177 (setf (f2cl-lib:fref cssr
(1) ((1 3))) cscl
)
178 (setf (f2cl-lib:fref cssr
(2) ((1 3))) coner
)
179 (setf (f2cl-lib:fref cssr
(3) ((1 3))) cscr
)
180 (setf (f2cl-lib:fref csrr
(1) ((1 3))) cscr
)
181 (setf (f2cl-lib:fref csrr
(2) ((1 3))) coner
)
182 (setf (f2cl-lib:fref csrr
(3) ((1 3))) cscl
)
183 (setf (f2cl-lib:fref bry
(1) ((1 3))) ascle
)
184 (setf (f2cl-lib:fref bry
(2) ((1 3))) (/ 1.0 ascle
))
185 (setf (f2cl-lib:fref bry
(3) ((1 3))) (f2cl-lib:d1mach
2))
186 (setf as2
(coerce (realpart (zabs s2r s2i
)) 'double-float
))
188 (if (> as2
(f2cl-lib:fref bry
(1) ((1 3)))) (go label50
))
192 (if (< as2
(f2cl-lib:fref bry
(2) ((1 3)))) (go label60
))
195 (setf bscle
(f2cl-lib:fref bry
(kflag) ((1 3))))
196 (setf s1r
(* s1r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
197 (setf s1i
(* s1i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
198 (setf s2r
(* s2r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
199 (setf s2i
(* s2i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
200 (setf csr
(f2cl-lib:fref csrr
(kflag) ((1 3))))
201 (f2cl-lib:fdo
(i 3 (f2cl-lib:int-add i
1))
206 (setf s2r
(+ (- (* ckr str
) (* cki sti
)) s1r
))
207 (setf s2i
(+ (* ckr sti
) (* cki str
) s1i
))
210 (setf c1r
(* s2r csr
))
211 (setf c1i
(* s2i csr
))
214 (setf c2r
(f2cl-lib:fref yr
(i) ((1 n
))))
215 (setf c2i
(f2cl-lib:fref yi
(i) ((1 n
))))
216 (if (= kode
1) (go label70
))
217 (if (< iuf
0) (go label70
))
219 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
)
220 (zs1s2 znr zni c1r c1i c2r c2i nw ascle alim iuf
)
221 (declare (ignore var-0 var-1 var-7 var-8
))
228 (setf nz
(f2cl-lib:int-add nz nw
))
233 (if (/= iuf
3) (go label70
))
235 (setf s1r
(* sc1r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
236 (setf s1i
(* sc1i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
237 (setf s2r
(* sc2r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
238 (setf s2i
(* sc2i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
242 (setf ptr
(- (* cspnr c1r
) (* cspni c1i
)))
243 (setf pti
(+ (* cspnr c1i
) (* cspni c1r
)))
244 (setf (f2cl-lib:fref yr
(i) ((1 n
)))
245 (- (+ ptr
(* csgnr c2r
)) (* csgni c2i
)))
246 (setf (f2cl-lib:fref yi
(i) ((1 n
)))
247 (+ pti
(* csgnr c2i
) (* csgni c2r
)))
248 (setf ckr
(+ ckr rzr
))
249 (setf cki
(+ cki rzi
))
250 (setf cspnr
(- cspnr
))
251 (setf cspni
(- cspni
))
252 (if (>= kflag
3) (go label80
))
255 (setf c1m
(max ptr pti
))
256 (if (<= c1m bscle
) (go label80
))
257 (setf kflag
(f2cl-lib:int-add kflag
1))
258 (setf bscle
(f2cl-lib:fref bry
(kflag) ((1 3))))
259 (setf s1r
(* s1r csr
))
260 (setf s1i
(* s1i csr
))
263 (setf s1r
(* s1r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
264 (setf s1i
(* s1i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
265 (setf s2r
(* s2r
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
266 (setf s2i
(* s2i
(f2cl-lib:fref cssr
(kflag) ((1 3)))))
267 (setf csr
(f2cl-lib:fref csrr
(kflag) ((1 3))))
272 (if (= nw -
2) (setf nz -
2))
276 (values nil nil nil nil nil nil nil nil nz nil nil nil nil nil
)))))
278 (in-package #:cl-user
)
279 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
280 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
281 (setf (gethash 'fortran-to-lisp
::zacon fortran-to-lisp
::*f2cl-function-info
*)
282 (fortran-to-lisp::make-f2cl-finfo
283 :arg-types
'((double-float) (double-float) (double-float)
284 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
285 (fortran-to-lisp::integer4
)
286 (simple-array double-float
(*))
287 (simple-array double-float
(*))
288 (fortran-to-lisp::integer4
) (double-float)
289 (double-float) (double-float) (double-float)
291 :return-values
'(nil nil nil nil nil nil nil nil fortran-to-lisp
::nz
293 :calls
'(fortran-to-lisp::zabs fortran-to-lisp
::zs1s2
294 fortran-to-lisp
::d1mach fortran-to-lisp
::zmlt
295 fortran-to-lisp
::zbknu fortran-to-lisp
::zbinu
))))