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)
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")
21 (declare (type (f2cl-lib:integer4
20 20) limit
) (ignorable limit
))
23 (n nfe iflag relerr abserr y yp yold ypold a qr alpha tz pivot w wp
25 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
26 (type (array double-float
(*)) par
)
27 (type (array f2cl-lib
:integer4
(*)) pivot
)
28 (type (array double-float
(*)) wp w tz alpha qr a ypold yold yp y
)
29 (type (double-float) abserr relerr
)
30 (type (f2cl-lib:integer4
) iflag nfe n
))
31 (f2cl-lib:with-multi-array-data
32 ((y double-float y-%data% y-%offset%
)
33 (yp double-float yp-%data% yp-%offset%
)
34 (yold double-float yold-%data% yold-%offset%
)
35 (ypold double-float ypold-%data% ypold-%offset%
)
36 (a double-float a-%data% a-%offset%
)
37 (qr double-float qr-%data% qr-%offset%
)
38 (alpha double-float alpha-%data% alpha-%offset%
)
39 (tz double-float tz-%data% tz-%offset%
)
40 (w double-float w-%data% w-%offset%
)
41 (wp double-float wp-%data% wp-%offset%
)
42 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
43 (par double-float par-%data% par-%offset%
)
44 (ipar f2cl-lib
:integer4 ipar-%data% ipar-%offset%
))
45 (labels ((dd01 (f0 f1 dels
)
46 (f2cl-lib:f2cl
/ (+ f1
(- f0
)) dels
))
47 (dd001 (f0 fp0 f1 dels
)
48 (/ (- (dd01 f0 f1 dels
) fp0
) dels
))
49 (dd011 (f0 f1 fp1 dels
)
50 (/ (- fp1
(dd01 f0 f1 dels
)) dels
))
51 (dd0011 (f0 fp0 f1 fp1 dels
)
52 (/ (- (dd011 f0 f1 fp1 dels
) (dd001 f0 fp0 f1 dels
)) dels
))
53 (qofs (f0 fp0 f1 fp1 dels s
)
58 (+ (* (dd0011 f0 fp0 f1 fp1 dels
) (- s dels
))
59 (dd001 f0 fp0 f1 dels
))
64 (declare (ftype (function (double-float double-float double-float
)
65 (values double-float
&rest t
))
67 (declare (ftype (function
68 (double-float double-float double-float double-float
)
69 (values double-float
&rest t
))
71 (declare (ftype (function
72 (double-float double-float double-float double-float
)
73 (values double-float
&rest t
))
75 (declare (ftype (function
76 (double-float double-float double-float double-float
78 (values double-float
&rest t
))
80 (declare (ftype (function
81 (double-float double-float double-float double-float
82 double-float double-float
)
83 (values double-float
&rest t
))
85 (prog ((judy 0) (jw 0) (lcode 0) (np1 0) (aerr 0.0) (dels 0.0) (f0 0.0)
86 (f1 0.0) (fp0 0.0) (fp1 0.0) (qsout 0.0) (rerr 0.0) (s 0.0)
87 (sa 0.0) (sb 0.0) (sout 0.0) (u 0.0))
88 (declare (type (f2cl-lib:integer4
) judy jw lcode np1
)
89 (type (double-float) aerr dels f0 f1 fp0 fp1 qsout rerr s sa
91 (setf u
(f2cl-lib:d1mach
4))
92 (setf rerr
(max relerr u
))
93 (setf aerr
(max abserr
0.0))
94 (setf np1
(f2cl-lib:int-add n
1))
96 (f2cl-lib:fdo
(judy 1 (f2cl-lib:int-add judy
1))
99 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
102 (setf (f2cl-lib:fref tz-%data%
104 ((1 (f2cl-lib:int-add n
1)))
107 (f2cl-lib:fref y-%data%
109 ((1 (f2cl-lib:int-add n
1)))
111 (f2cl-lib:fref yold-%data%
113 ((1 (f2cl-lib:int-add n
1)))
116 (setf dels
(dnrm2 np1 tz
1))
117 (setf sa
(coerce 0.0f0
'double-float
))
121 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
122 (root sout qsout sa sb rerr aerr lcode
)
123 (declare (ignore var-1 var-4 var-5
))
128 (if (> lcode
0) (go label140
))
132 (f2cl-lib:fref yold-%data%
134 ((1 (f2cl-lib:int-add n
1)))
136 (f2cl-lib:fref ypold-%data%
138 ((1 (f2cl-lib:int-add n
1)))
140 (f2cl-lib:fref y-%data%
142 ((1 (f2cl-lib:int-add n
1)))
144 (f2cl-lib:fref yp-%data%
146 ((1 (f2cl-lib:int-add n
1)))
156 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
159 (setf (f2cl-lib:fref w-%data%
161 ((1 (f2cl-lib:int-add n
1)))
164 (f2cl-lib:fref yold-%data%
166 ((1 (f2cl-lib:int-add n
1)))
168 (f2cl-lib:fref ypold-%data%
170 ((1 (f2cl-lib:int-add n
1)))
172 (f2cl-lib:fref y-%data%
174 ((1 (f2cl-lib:int-add n
1)))
176 (f2cl-lib:fref yp-%data%
178 ((1 (f2cl-lib:int-add n
1)))
183 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
184 var-9 var-10 var-11 var-12 var-13
)
185 (tangnf sa w wp ypold a qr alpha tz pivot nfe n iflag par
187 (declare (ignore var-1 var-2 var-3 var-4 var-5 var-6 var-7
188 var-8 var-10 var-12 var-13
))
192 (if (> iflag
0) (go end_label
))
193 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
196 (setf (f2cl-lib:fref w-%data%
198 ((1 (f2cl-lib:int-add n
1)))
201 (f2cl-lib:fref w-%data%
203 ((1 (f2cl-lib:int-add n
1)))
205 (f2cl-lib:fref tz-%data%
207 ((1 (f2cl-lib:int-add n
1)))
211 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
212 var-9 var-10 var-11 var-12 var-13
)
213 (tangnf sa w wp ypold a qr alpha tz pivot nfe n iflag par
215 (declare (ignore var-1 var-2 var-3 var-4 var-5 var-6 var-7
216 var-8 var-10 var-12 var-13
))
220 (if (> iflag
0) (go end_label
))
221 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
224 (setf (f2cl-lib:fref w-%data%
226 ((1 (f2cl-lib:int-add n
1)))
229 (f2cl-lib:fref w-%data%
231 ((1 (f2cl-lib:int-add n
1)))
233 (f2cl-lib:fref tz-%data%
235 ((1 (f2cl-lib:int-add n
1)))
242 (+ (f2cl-lib:fref w
(1) ((1 (f2cl-lib:int-add n
1))))
247 (f2cl-lib:array-slice tz
250 ((1 (f2cl-lib:int-add n
1))))
255 (f2cl-lib:array-slice w
258 ((1 (f2cl-lib:int-add n
1))))
261 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
264 (setf (f2cl-lib:fref y-%data%
266 ((1 (f2cl-lib:int-add n
1)))
268 (f2cl-lib:fref w-%data%
270 ((1 (f2cl-lib:int-add n
1)))
277 (+ (f2cl-lib:fref yold
(1) ((1 (f2cl-lib:int-add n
1))))
279 (+ (f2cl-lib:fref w
(1) ((1 (f2cl-lib:int-add n
1))))
282 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
285 (setf (f2cl-lib:fref yold-%data%
287 ((1 (f2cl-lib:int-add n
1)))
289 (f2cl-lib:fref w-%data%
291 ((1 (f2cl-lib:int-add n
1)))
293 (setf (f2cl-lib:fref ypold-%data%
295 ((1 (f2cl-lib:int-add n
1)))
297 (f2cl-lib:fref wp-%data%
299 ((1 (f2cl-lib:int-add n
1)))
303 (f2cl-lib:fdo
(jw 1 (f2cl-lib:int-add jw
1))
306 (setf (f2cl-lib:fref y-%data%
308 ((1 (f2cl-lib:int-add n
1)))
310 (f2cl-lib:fref w-%data%
312 ((1 (f2cl-lib:int-add n
1)))
314 (setf (f2cl-lib:fref yp-%data%
316 ((1 (f2cl-lib:int-add n
1)))
318 (f2cl-lib:fref wp-%data%
320 ((1 (f2cl-lib:int-add n
1)))
347 (in-package #:cl-user
)
348 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
349 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
350 (setf (gethash 'fortran-to-lisp
::rootnf
351 fortran-to-lisp
::*f2cl-function-info
*)
352 (fortran-to-lisp::make-f2cl-finfo
353 :arg-types
'((fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
354 (fortran-to-lisp::integer4
) (double-float)
355 (double-float) (array double-float
(*))
356 (array double-float
(*)) (array double-float
(*))
357 (array double-float
(*)) (array double-float
(*))
358 (array double-float
(*)) (array double-float
(*))
359 (array double-float
(*))
360 (array fortran-to-lisp
::integer4
(*))
361 (array double-float
(*)) (array double-float
(*))
362 (array double-float
(*))
363 (array fortran-to-lisp
::integer4
(*)))
364 :return-values
'(nil fortran-to-lisp
::nfe fortran-to-lisp
::iflag nil
365 nil nil nil nil nil nil nil nil nil nil nil nil nil
367 :calls
'(fortran-to-lisp::dnrm2 fortran-to-lisp
::tangnf
368 fortran-to-lisp
::root fortran-to-lisp
::d1mach
))))