Remove the obsolete DEFMTRFUN-EXTERNAL macro
[maxima.git] / share / hompack / lisp / ffunp.lisp
blobf096822a9f977514b57d1cb163b9e7301c878a51
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 double-float))
17 (in-package "HOMPACK")
20 (defun ffunp (n numt mmaxt kdeg coef cl x xx trm dtrm clx dxnp1 f df)
21 (declare (type (array double-float (*)) df f dxnp1 clx dtrm trm xx x cl coef)
22 (type (array f2cl-lib:integer4 (*)) kdeg numt)
23 (type (f2cl-lib:integer4) mmaxt n))
24 (f2cl-lib:with-multi-array-data
25 ((numt f2cl-lib:integer4 numt-%data% numt-%offset%)
26 (kdeg f2cl-lib:integer4 kdeg-%data% kdeg-%offset%)
27 (coef double-float coef-%data% coef-%offset%)
28 (cl double-float cl-%data% cl-%offset%)
29 (x double-float x-%data% x-%offset%)
30 (xx double-float xx-%data% xx-%offset%)
31 (trm double-float trm-%data% trm-%offset%)
32 (dtrm double-float dtrm-%data% dtrm-%offset%)
33 (clx double-float clx-%data% clx-%offset%)
34 (dxnp1 double-float dxnp1-%data% dxnp1-%offset%)
35 (f double-float f-%data% f-%offset%)
36 (df double-float df-%data% df-%offset%))
37 (prog ((temp1 (make-array 2 :element-type 'double-float))
38 (temp2 (make-array 2 :element-type 'double-float))
39 (xnp1 (make-array 2 :element-type 'double-float)) (i 0) (ierr 0)
40 (j 0) (k 0) (l 0) (m 0) (nnnn 0) (np1 0))
41 (declare (type (f2cl-lib:integer4) np1 nnnn m l k j ierr i)
42 (type (array double-float (2)) xnp1 temp2 temp1))
43 (setf np1 (f2cl-lib:int-add n 1))
44 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
45 ((> j n) nil)
46 (tagbody
47 (mulp
48 (f2cl-lib:array-slice cl-%data%
49 double-float
50 (1 j)
51 ((1 2) (1 (f2cl-lib:int-add n 1)))
52 cl-%offset%)
53 (f2cl-lib:array-slice x-%data%
54 double-float
55 (1 j)
56 ((1 2) (1 n))
57 x-%offset%)
58 (f2cl-lib:array-slice clx-%data%
59 double-float
60 (1 j)
61 ((1 2) (1 n))
62 clx-%offset%))
63 label40))
64 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
65 ((> i 2) nil)
66 (tagbody
67 (setf (f2cl-lib:fref xnp1 (i) ((1 2)))
68 (f2cl-lib:fref cl-%data%
69 (i np1)
70 ((1 2) (1 (f2cl-lib:int-add n 1)))
71 cl-%offset%))
72 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
73 ((> j n) nil)
74 (tagbody
75 (setf (f2cl-lib:fref xnp1 (i) ((1 2)))
76 (+ (f2cl-lib:fref xnp1 (i) ((1 2)))
77 (f2cl-lib:fref clx-%data%
78 (i j)
79 ((1 2) (1 n))
80 clx-%offset%)))
81 (setf (f2cl-lib:fref dxnp1-%data%
82 (i j)
83 ((1 2) (1 n))
84 dxnp1-%offset%)
85 (f2cl-lib:fref cl-%data%
86 (i j)
87 ((1 2) (1 (f2cl-lib:int-add n 1)))
88 cl-%offset%))
89 label50))
90 label60))
91 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
92 ((> j n) nil)
93 (tagbody
94 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
95 ((> k (f2cl-lib:fref numt (j) ((1 n)))) nil)
96 (tagbody
97 (powp
98 (f2cl-lib:fref kdeg-%data%
99 (j np1 k)
100 ((1 n) (1 (f2cl-lib:int-add n 1)) (1 mmaxt))
101 kdeg-%offset%)
102 xnp1
103 (f2cl-lib:array-slice xx-%data%
104 double-float
105 (1 j np1 k)
106 ((1 2) (1 n) (1 (f2cl-lib:int-add n 1))
107 (1 mmaxt))
108 xx-%offset%))
109 (f2cl-lib:fdo (l 1 (f2cl-lib:int-add l 1))
110 ((> l n) nil)
111 (tagbody
112 (powp
113 (f2cl-lib:fref kdeg-%data%
114 (j l k)
115 ((1 n) (1 (f2cl-lib:int-add n 1)) (1 mmaxt))
116 kdeg-%offset%)
117 (f2cl-lib:array-slice x-%data%
118 double-float
119 (1 l)
120 ((1 2) (1 n))
121 x-%offset%)
122 (f2cl-lib:array-slice xx-%data%
123 double-float
124 (1 j l k)
125 ((1 2) (1 n)
126 (1 (f2cl-lib:int-add n 1)) (1 mmaxt))
127 xx-%offset%))
128 label100))))))
129 label100
130 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
131 ((> j n) nil)
132 (tagbody
133 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
134 ((> k (f2cl-lib:fref numt (j) ((1 n)))) nil)
135 (tagbody
136 (setf (f2cl-lib:fref trm-%data%
137 (1 j k)
138 ((1 2) (1 n) (1 mmaxt))
139 trm-%offset%)
140 (f2cl-lib:fref coef-%data%
141 (j k)
142 ((1 n) (1 mmaxt))
143 coef-%offset%))
144 (setf (f2cl-lib:fref trm-%data%
145 (2 j k)
146 ((1 2) (1 n) (1 mmaxt))
147 trm-%offset%)
148 (coerce 0.0f0 'double-float))
149 (f2cl-lib:fdo (l 1 (f2cl-lib:int-add l 1))
150 ((> l np1) nil)
151 (tagbody
152 (mulp
153 (f2cl-lib:array-slice xx-%data%
154 double-float
155 (1 j l k)
156 ((1 2) (1 n)
157 (1 (f2cl-lib:int-add n 1)) (1 mmaxt))
158 xx-%offset%)
159 (f2cl-lib:array-slice trm-%data%
160 double-float
161 (1 j k)
162 ((1 2) (1 n) (1 mmaxt))
163 trm-%offset%)
164 temp1)
165 (setf (f2cl-lib:fref trm-%data%
166 (1 j k)
167 ((1 2) (1 n) (1 mmaxt))
168 trm-%offset%)
169 (f2cl-lib:fref temp1 (1) ((1 2))))
170 (setf (f2cl-lib:fref trm-%data%
171 (2 j k)
172 ((1 2) (1 n) (1 mmaxt))
173 trm-%offset%)
174 (f2cl-lib:fref temp1 (2) ((1 2))))
175 label120))
176 label200))))
177 label200
178 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
179 ((> j n) nil)
180 (tagbody
181 (setf (f2cl-lib:fref f-%data% (1 j) ((1 2) (1 n)) f-%offset%)
182 (coerce 0.0f0 'double-float))
183 (setf (f2cl-lib:fref f-%data% (2 j) ((1 2) (1 n)) f-%offset%)
184 (coerce 0.0f0 'double-float))
185 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
186 ((> i 2) nil)
187 (tagbody
188 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
189 ((> k (f2cl-lib:fref numt (j) ((1 n)))) nil)
190 (tagbody
191 (setf (f2cl-lib:fref f-%data% (i j) ((1 2) (1 n)) f-%offset%)
193 (f2cl-lib:fref f-%data%
194 (i j)
195 ((1 2) (1 n))
196 f-%offset%)
197 (f2cl-lib:fref trm-%data%
198 (i j k)
199 ((1 2) (1 n) (1 mmaxt))
200 trm-%offset%)))
201 label220))))
202 label220
203 label300))
204 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
205 ((> j n) nil)
206 (tagbody
207 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
208 ((> k (f2cl-lib:fref numt (j) ((1 n)))) nil)
209 (tagbody
210 (f2cl-lib:fdo (m 1 (f2cl-lib:int-add m 1))
211 ((> m np1) nil)
212 (tagbody
213 (cond
215 (f2cl-lib:fref kdeg
216 (j m k)
217 ((1 n) (1 (f2cl-lib:int-add n 1))
218 (1 mmaxt)))
220 (setf (f2cl-lib:fref dtrm-%data%
221 (1 j m k)
222 ((1 2) (1 n)
223 (1 (f2cl-lib:int-add n 1))
224 (1 mmaxt))
225 dtrm-%offset%)
226 (coerce 0.0f0 'double-float))
227 (setf (f2cl-lib:fref dtrm-%data%
228 (2 j m k)
229 ((1 2) (1 n)
230 (1 (f2cl-lib:int-add n 1))
231 (1 mmaxt))
232 dtrm-%offset%)
233 (coerce 0.0f0 'double-float)))
235 (if (<= m n)
236 (multiple-value-bind (var-0 var-1 var-2 var-3)
237 (divp
238 (f2cl-lib:array-slice trm-%data%
239 double-float
240 (1 j k)
241 ((1 2) (1 n) (1 mmaxt))
242 trm-%offset%)
243 (f2cl-lib:array-slice x-%data%
244 double-float
245 (1 m)
246 ((1 2) (1 n))
247 x-%offset%)
248 (f2cl-lib:array-slice dtrm-%data%
249 double-float
250 (1 j m k)
251 ((1 2) (1 n)
252 (1 (f2cl-lib:int-add n 1))
253 (1 mmaxt))
254 dtrm-%offset%)
255 ierr)
256 (declare (ignore var-0 var-1 var-2))
257 (setf ierr var-3)))
258 (if (= m np1)
259 (multiple-value-bind (var-0 var-1 var-2 var-3)
260 (divp
261 (f2cl-lib:array-slice trm-%data%
262 double-float
263 (1 j k)
264 ((1 2) (1 n) (1 mmaxt))
265 trm-%offset%)
266 xnp1
267 (f2cl-lib:array-slice dtrm-%data%
268 double-float
269 (1 j m k)
270 ((1 2) (1 n)
271 (1 (f2cl-lib:int-add n 1))
272 (1 mmaxt))
273 dtrm-%offset%)
274 ierr)
275 (declare (ignore var-0 var-1 var-2))
276 (setf ierr var-3)))
277 (cond
278 ((= ierr 0)
279 (setf (f2cl-lib:fref dtrm-%data%
280 (1 j m k)
281 ((1 2) (1 n)
282 (1 (f2cl-lib:int-add n 1))
283 (1 mmaxt))
284 dtrm-%offset%)
286 (f2cl-lib:fref kdeg-%data%
287 (j m k)
288 ((1 n)
289 (1 (f2cl-lib:int-add n 1))
290 (1 mmaxt))
291 kdeg-%offset%)
292 (f2cl-lib:fref dtrm-%data%
293 (1 j m k)
294 ((1 2) (1 n)
295 (1 (f2cl-lib:int-add n 1))
296 (1 mmaxt))
297 dtrm-%offset%)))
298 (setf (f2cl-lib:fref dtrm-%data%
299 (2 j m k)
300 ((1 2) (1 n)
301 (1 (f2cl-lib:int-add n 1))
302 (1 mmaxt))
303 dtrm-%offset%)
305 (f2cl-lib:fref kdeg-%data%
306 (j m k)
307 ((1 n)
308 (1 (f2cl-lib:int-add n 1))
309 (1 mmaxt))
310 kdeg-%offset%)
311 (f2cl-lib:fref dtrm-%data%
312 (2 j m k)
313 ((1 2) (1 n)
314 (1 (f2cl-lib:int-add n 1))
315 (1 mmaxt))
316 dtrm-%offset%))))
318 (setf (f2cl-lib:fref dtrm-%data%
319 (1 j m k)
320 ((1 2) (1 n)
321 (1 (f2cl-lib:int-add n 1))
322 (1 mmaxt))
323 dtrm-%offset%)
324 (f2cl-lib:fref coef-%data%
325 (j k)
326 ((1 n) (1 mmaxt))
327 coef-%offset%))
328 (setf (f2cl-lib:fref dtrm-%data%
329 (2 j m k)
330 ((1 2) (1 n)
331 (1 (f2cl-lib:int-add n 1))
332 (1 mmaxt))
333 dtrm-%offset%)
334 (coerce 0.0f0 'double-float))
335 (f2cl-lib:fdo (l 1 (f2cl-lib:int-add l 1))
336 ((> l np1) nil)
337 (tagbody
338 (if (= l m) (go label320))
339 (mulp
340 (f2cl-lib:array-slice xx-%data%
341 double-float
342 (1 j l k)
343 ((1 2) (1 n)
344 (1 (f2cl-lib:int-add n 1))
345 (1 mmaxt))
346 xx-%offset%)
347 (f2cl-lib:array-slice dtrm-%data%
348 double-float
349 (1 j m k)
350 ((1 2) (1 n)
351 (1 (f2cl-lib:int-add n 1))
352 (1 mmaxt))
353 dtrm-%offset%)
354 temp1)
355 (setf (f2cl-lib:fref dtrm-%data%
356 (1 j m k)
357 ((1 2) (1 n)
358 (1 (f2cl-lib:int-add n 1))
359 (1 mmaxt))
360 dtrm-%offset%)
361 (f2cl-lib:fref temp1 (1) ((1 2))))
362 (setf (f2cl-lib:fref dtrm-%data%
363 (2 j m k)
364 ((1 2) (1 n)
365 (1 (f2cl-lib:int-add n 1))
366 (1 mmaxt))
367 dtrm-%offset%)
368 (f2cl-lib:fref temp1 (2) ((1 2))))
369 label320))
370 (setf nnnn
371 (f2cl-lib:int-sub
372 (f2cl-lib:fref kdeg-%data%
373 (j m k)
374 ((1 n)
375 (1 (f2cl-lib:int-add n 1))
376 (1 mmaxt))
377 kdeg-%offset%)
379 (if (<= m n)
380 (powp nnnn
381 (f2cl-lib:array-slice x-%data%
382 double-float
383 (1 m)
384 ((1 2) (1 n))
385 x-%offset%)
386 temp2))
387 (if (= m np1) (powp nnnn xnp1 temp2))
388 (mulp temp2 temp1
389 (f2cl-lib:array-slice dtrm-%data%
390 double-float
391 (1 j m k)
392 ((1 2) (1 n)
393 (1 (f2cl-lib:int-add n 1))
394 (1 mmaxt))
395 dtrm-%offset%))
396 (setf (f2cl-lib:fref dtrm-%data%
397 (1 j m k)
398 ((1 2) (1 n)
399 (1 (f2cl-lib:int-add n 1))
400 (1 mmaxt))
401 dtrm-%offset%)
403 (f2cl-lib:fref kdeg-%data%
404 (j m k)
405 ((1 n)
406 (1 (f2cl-lib:int-add n 1))
407 (1 mmaxt))
408 kdeg-%offset%)
409 (f2cl-lib:fref dtrm-%data%
410 (1 j m k)
411 ((1 2) (1 n)
412 (1 (f2cl-lib:int-add n 1))
413 (1 mmaxt))
414 dtrm-%offset%)))
415 (setf (f2cl-lib:fref dtrm-%data%
416 (2 j m k)
417 ((1 2) (1 n)
418 (1 (f2cl-lib:int-add n 1))
419 (1 mmaxt))
420 dtrm-%offset%)
422 (f2cl-lib:fref kdeg-%data%
423 (j m k)
424 ((1 n)
425 (1 (f2cl-lib:int-add n 1))
426 (1 mmaxt))
427 kdeg-%offset%)
428 (f2cl-lib:fref dtrm-%data%
429 (2 j m k)
430 ((1 2) (1 n)
431 (1 (f2cl-lib:int-add n 1))
432 (1 mmaxt))
433 dtrm-%offset%)))))))
434 label400))))))
435 label400
436 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
437 ((> j n) nil)
438 (tagbody
439 (f2cl-lib:fdo (m 1 (f2cl-lib:int-add m 1))
440 ((> m np1) nil)
441 (tagbody
442 (setf (f2cl-lib:fref df-%data%
443 (1 j m)
444 ((1 2) (1 n) (1 (f2cl-lib:int-add n 1)))
445 df-%offset%)
446 (coerce 0.0f0 'double-float))
447 (setf (f2cl-lib:fref df-%data%
448 (2 j m)
449 ((1 2) (1 n) (1 (f2cl-lib:int-add n 1)))
450 df-%offset%)
451 (coerce 0.0f0 'double-float))
452 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
453 ((> i 2) nil)
454 (tagbody
455 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
456 ((> k (f2cl-lib:fref numt (j) ((1 n)))) nil)
457 (tagbody
458 (setf (f2cl-lib:fref df-%data%
459 (i j m)
460 ((1 2) (1 n)
461 (1 (f2cl-lib:int-add n 1)))
462 df-%offset%)
464 (f2cl-lib:fref df-%data%
465 (i j m)
466 ((1 2) (1 n)
467 (1 (f2cl-lib:int-add n 1)))
468 df-%offset%)
469 (f2cl-lib:fref dtrm-%data%
470 (i j m k)
471 ((1 2) (1 n)
472 (1 (f2cl-lib:int-add n 1))
473 (1 mmaxt))
474 dtrm-%offset%)))
475 label420))))
476 label420
477 label600))))
478 label600
479 (f2cl-lib:fdo (j 1 (f2cl-lib:int-add j 1))
480 ((> j n) nil)
481 (tagbody
482 (f2cl-lib:fdo (k 1 (f2cl-lib:int-add k 1))
483 ((> k n) nil)
484 (tagbody
485 (mulp
486 (f2cl-lib:array-slice df-%data%
487 double-float
488 (1 j np1)
489 ((1 2) (1 n) (1 (f2cl-lib:int-add n 1)))
490 df-%offset%)
491 (f2cl-lib:array-slice dxnp1-%data%
492 double-float
493 (1 k)
494 ((1 2) (1 n))
495 dxnp1-%offset%)
496 temp1)
497 (f2cl-lib:fdo (i 1 (f2cl-lib:int-add i 1))
498 ((> i 2) nil)
499 (tagbody
500 (setf (f2cl-lib:fref df-%data%
501 (i j k)
502 ((1 2) (1 n) (1 (f2cl-lib:int-add n 1)))
503 df-%offset%)
505 (f2cl-lib:fref df-%data%
506 (i j k)
507 ((1 2) (1 n)
508 (1 (f2cl-lib:int-add n 1)))
509 df-%offset%)
510 (f2cl-lib:fref temp1 (i) ((1 2)))))
511 label700))))))
512 label700
513 (go end_label)
514 end_label
515 (return
516 (values nil nil nil nil nil nil nil nil nil nil nil nil nil nil)))))
518 (in-package #:cl-user)
519 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
520 (eval-when (:load-toplevel :compile-toplevel :execute)
521 (setf (gethash 'fortran-to-lisp::ffunp fortran-to-lisp::*f2cl-function-info*)
522 (fortran-to-lisp::make-f2cl-finfo
523 :arg-types '((fortran-to-lisp::integer4)
524 (array fortran-to-lisp::integer4 (*))
525 (fortran-to-lisp::integer4)
526 (array fortran-to-lisp::integer4 (*))
527 (array double-float (*)) (array double-float (*))
528 (array double-float (*)) (array double-float (*))
529 (array double-float (*)) (array double-float (*))
530 (array double-float (*)) (array double-float (*))
531 (array double-float (*)) (array double-float (*)))
532 :return-values '(nil nil nil nil nil nil nil nil nil nil nil nil nil
533 nil)
534 :calls '(fortran-to-lisp::divp fortran-to-lisp::powp
535 fortran-to-lisp::mulp))))