Rework documentation for lratsubst in hope of greater clarity.
[maxima.git] / share / fftpack5 / lisp / cosqb1.lisp
blob4ec12dfc986b63f17285a5fb92957bd7d9bb4171
1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
3 ;;; "f2cl2.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
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 95098eb54f13 2013/04/01 00:45:16 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 1409c1352feb 2013/03/24 20:44:50 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2020-04 (21D Unicode)
11 ;;;
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format single-float))
17 (in-package "FFTPACK5")
20 (defun cosqb1 (n inc x wsave work ier)
21 (declare (type (array double-float (*)) work wsave x)
22 (type (f2cl-lib:integer4) ier inc n))
23 (f2cl-lib:with-multi-array-data
24 ((x double-float x-%data% x-%offset%)
25 (wsave double-float wsave-%data% wsave-%offset%)
26 (work double-float work-%data% work-%offset%))
27 (prog ((kc 0) (k 0) (ier1 0) (lnwk 0) (lnsv 0) (lenx 0) (modn 0)
28 (xim1 0.0d0) (i 0) (np2 0) (ns2 0))
29 (declare (type (double-float) xim1)
30 (type (f2cl-lib:integer4) ns2 np2 i modn lenx lnsv lnwk ier1 k
31 kc))
32 (setf ier 0)
33 (setf ns2 (the f2cl-lib:integer4 (truncate (+ n 1) 2)))
34 (setf np2 (f2cl-lib:int-add n 2))
35 (f2cl-lib:fdo (i 3 (f2cl-lib:int-add i 2))
36 ((> i n) nil)
37 (tagbody
38 (setf xim1
40 (f2cl-lib:fref x-%data%
41 (1 (f2cl-lib:int-sub i 1))
42 ((1 inc) (1 *))
43 x-%offset%)
44 (f2cl-lib:fref x-%data% (1 i) ((1 inc) (1 *)) x-%offset%)))
45 (setf (f2cl-lib:fref x-%data% (1 i) ((1 inc) (1 *)) x-%offset%)
46 (* 0.5d0
48 (f2cl-lib:fref x-%data%
49 (1 (f2cl-lib:int-sub i 1))
50 ((1 inc) (1 *))
51 x-%offset%)
52 (f2cl-lib:fref x-%data%
53 (1 i)
54 ((1 inc) (1 *))
55 x-%offset%))))
56 (setf (f2cl-lib:fref x-%data%
57 (1 (f2cl-lib:int-sub i 1))
58 ((1 inc) (1 *))
59 x-%offset%)
60 (* 0.5d0 xim1))
61 label101))
62 (setf (f2cl-lib:fref x-%data% (1 1) ((1 inc) (1 *)) x-%offset%)
63 (* 0.5d0
64 (f2cl-lib:fref x-%data% (1 1) ((1 inc) (1 *)) x-%offset%)))
65 (setf modn (mod n 2))
66 (if (/= modn 0) (go label302))
67 (setf (f2cl-lib:fref x-%data% (1 n) ((1 inc) (1 *)) x-%offset%)
68 (* 0.5d0
69 (f2cl-lib:fref x-%data% (1 n) ((1 inc) (1 *)) x-%offset%)))
70 label302
71 (setf lenx
72 (f2cl-lib:int-add (f2cl-lib:int-mul inc (f2cl-lib:int-sub n 1))
73 1))
74 (setf lnsv
75 (f2cl-lib:int-add n
76 (f2cl-lib:int
77 (/ (f2cl-lib:flog (f2cl-lib:freal n))
78 (f2cl-lib:flog 2.0d0)))
79 4))
80 (setf lnwk n)
81 (multiple-value-bind
82 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8)
83 (rfft1b n inc x lenx
84 (f2cl-lib:array-slice wsave-%data%
85 double-float
86 ((+ n 1))
87 ((1 *))
88 wsave-%offset%)
89 lnsv work lnwk ier1)
90 (declare (ignore var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7))
91 (setf ier1 var-8))
92 (cond
93 ((/= ier1 0)
94 (setf ier 20)
95 (xerfft "COSQB1" -5)
96 (go label400)))
97 (f2cl-lib:fdo (k 2 (f2cl-lib:int-add k 1))
98 ((> k ns2) nil)
99 (tagbody
100 (setf kc (f2cl-lib:int-sub np2 k))
101 (setf (f2cl-lib:fref work-%data% (k) ((1 *)) work-%offset%)
104 (f2cl-lib:fref wsave-%data%
105 ((f2cl-lib:int-sub k 1))
106 ((1 *))
107 wsave-%offset%)
108 (f2cl-lib:fref x-%data% (1 kc) ((1 inc) (1 *)) x-%offset%))
110 (f2cl-lib:fref wsave-%data%
111 ((f2cl-lib:int-sub kc 1))
112 ((1 *))
113 wsave-%offset%)
114 (f2cl-lib:fref x-%data%
115 (1 k)
116 ((1 inc) (1 *))
117 x-%offset%))))
118 (setf (f2cl-lib:fref work-%data% (kc) ((1 *)) work-%offset%)
121 (f2cl-lib:fref wsave-%data%
122 ((f2cl-lib:int-sub k 1))
123 ((1 *))
124 wsave-%offset%)
125 (f2cl-lib:fref x-%data% (1 k) ((1 inc) (1 *)) x-%offset%))
127 (f2cl-lib:fref wsave-%data%
128 ((f2cl-lib:int-sub kc 1))
129 ((1 *))
130 wsave-%offset%)
131 (f2cl-lib:fref x-%data%
132 (1 kc)
133 ((1 inc) (1 *))
134 x-%offset%))))
135 label102))
136 (if (/= modn 0) (go label305))
137 (setf (f2cl-lib:fref x-%data%
138 (1 (f2cl-lib:int-add ns2 1))
139 ((1 inc) (1 *))
140 x-%offset%)
141 (* (f2cl-lib:fref wsave-%data% (ns2) ((1 *)) wsave-%offset%)
143 (f2cl-lib:fref x-%data%
144 (1 (f2cl-lib:int-add ns2 1))
145 ((1 inc) (1 *))
146 x-%offset%)
147 (f2cl-lib:fref x-%data%
148 (1 (f2cl-lib:int-add ns2 1))
149 ((1 inc) (1 *))
150 x-%offset%))))
151 label305
152 (f2cl-lib:fdo (k 2 (f2cl-lib:int-add k 1))
153 ((> k ns2) nil)
154 (tagbody
155 (setf kc (f2cl-lib:int-sub np2 k))
156 (setf (f2cl-lib:fref x-%data% (1 k) ((1 inc) (1 *)) x-%offset%)
157 (+ (f2cl-lib:fref work-%data% (k) ((1 *)) work-%offset%)
158 (f2cl-lib:fref work-%data% (kc) ((1 *)) work-%offset%)))
159 (setf (f2cl-lib:fref x-%data% (1 kc) ((1 inc) (1 *)) x-%offset%)
160 (- (f2cl-lib:fref work-%data% (k) ((1 *)) work-%offset%)
161 (f2cl-lib:fref work-%data% (kc) ((1 *)) work-%offset%)))
162 label103))
163 (setf (f2cl-lib:fref x-%data% (1 1) ((1 inc) (1 *)) x-%offset%)
164 (+ (f2cl-lib:fref x-%data% (1 1) ((1 inc) (1 *)) x-%offset%)
165 (f2cl-lib:fref x-%data% (1 1) ((1 inc) (1 *)) x-%offset%)))
166 label400
167 (go end_label)
168 end_label
169 (return (values nil nil nil nil nil ier)))))
171 (in-package #:cl-user)
172 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
173 (eval-when (:load-toplevel :compile-toplevel :execute)
174 (setf (gethash 'fortran-to-lisp::cosqb1
175 fortran-to-lisp::*f2cl-function-info*)
176 (fortran-to-lisp::make-f2cl-finfo
177 :arg-types '((fortran-to-lisp::integer4) (fortran-to-lisp::integer4)
178 (array double-float (*)) (array double-float (*))
179 (array double-float (*)) (fortran-to-lisp::integer4))
180 :return-values '(nil nil nil nil nil fortran-to-lisp::ier)
181 :calls '(fortran-to-lisp::xerfft fortran-to-lisp::rfft1b))))