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
4 4) litfh
) (ignorable litfh
))
23 (n nfe iflag start crash hold h relerr abserr s y yp yold ypold a qr
24 lenqr pivot work sspar par ipar
)
25 (declare (type (array f2cl-lib
:integer4
(*)) ipar
)
26 (type (array double-float
(*)) par
)
27 (type (array double-float
(*)) sspar
)
28 (type (array f2cl-lib
:integer4
(*)) pivot
)
29 (type (array double-float
(*)) work qr a ypold yold yp y
)
30 (type (double-float) s abserr relerr h hold
)
31 (type f2cl-lib
:logical crash start
)
32 (type (f2cl-lib:integer4
) lenqr iflag nfe n
))
33 (f2cl-lib:with-multi-array-data
34 ((y double-float y-%data% y-%offset%
)
35 (yp double-float yp-%data% yp-%offset%
)
36 (yold double-float yold-%data% yold-%offset%
)
37 (ypold double-float ypold-%data% ypold-%offset%
)
38 (a double-float a-%data% a-%offset%
)
39 (qr double-float qr-%data% qr-%offset%
)
40 (work double-float work-%data% work-%offset%
)
41 (pivot f2cl-lib
:integer4 pivot-%data% pivot-%offset%
)
42 (sspar double-float sspar-%data% sspar-%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 ((fail nil
) (ipp 0) (irho 0) (itangw 0) (itnum 0) (itz 0) (iw 0)
86 (iwp 0) (iz0 0) (iz1 0) (j 0) (judy 0) (np1 0) (dcalc 0.0)
87 (dels 0.0) (f0 0.0) (f1 0.0) (fouru 0.0) (fp0 0.0) (fp1 0.0)
88 (hfail 0.0) (ht 0.0) (lcalc 0.0) (rcalc 0.0) (rholen 0.0)
89 (temp 0.0) (twou 0.0))
90 (declare (type f2cl-lib
:logical fail
)
91 (type (f2cl-lib:integer4
) ipp irho itangw itnum itz iw iwp
93 (type (double-float) dcalc dels f0 f1 fouru fp0 fp1 hfail ht
94 lcalc rcalc rholen temp twou
))
95 (setf twou
(* 2.0f0
(f2cl-lib:d1mach
4)))
96 (setf fouru
(+ twou twou
))
97 (setf np1
(f2cl-lib:int-add n
1))
99 (setf irho
(f2cl-lib:int-add n
1))
100 (setf iw
(f2cl-lib:int-add irho n
))
101 (setf iwp
(f2cl-lib:int-add iw np1
))
102 (setf itz
(f2cl-lib:int-add iwp np1
))
103 (setf iz0
(f2cl-lib:int-add itz np1
))
104 (setf iz1
(f2cl-lib:int-add iz0 np1
))
105 (setf itangw
(f2cl-lib:int-add iz1 np1
))
106 (setf crash f2cl-lib
:%true%
)
107 (if (< s
0.0f0
) (go end_label
))
109 ((< h
(* fouru
(+ 1.0f0 s
)))
110 (setf h
(* fouru
(+ 1.0f0 s
)))
112 (setf temp
(dnrm2 np1 y
1))
113 (if (>= (* 0.5f0
(+ (* relerr temp
) abserr
)) (* twou temp
))
117 (setf relerr
(* fouru
(+ 1.0f0 fouru
)))
118 (setf abserr
(max abserr
0.0)))
120 (setf abserr
(* fouru temp
))))
123 (setf crash f2cl-lib
:%false%
)
124 (if (not start
) (go label300
))
125 (setf fail f2cl-lib
:%false%
)
126 (setf start f2cl-lib
:%false%
)
131 (f2cl-lib:fsqrt
(+ (* relerr temp
) abserr
)))))
132 (setf (f2cl-lib:fref ypold-%data%
134 ((1 (f2cl-lib:int-add n
1)))
136 (coerce 1.0f0
'double-float
))
137 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
140 (setf (f2cl-lib:fref ypold-%data%
142 ((1 (f2cl-lib:int-add n
1)))
144 (coerce 0.0f0
'double-float
))
147 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8 var-9
148 var-10 var-11 var-12 var-13 var-14 var-15 var-16
)
150 (f2cl-lib:array-slice work-%data%
158 (f2cl-lib:int-mul
2 n
)
161 ypold a qr lenqr pivot
162 (f2cl-lib:array-slice work-%data%
170 (f2cl-lib:int-mul
2 n
)
173 (f2cl-lib:array-slice work-%data%
181 (f2cl-lib:int-mul
2 n
)
184 (f2cl-lib:array-slice work-%data%
192 (f2cl-lib:int-mul
2 n
)
195 nfe n iflag par ipar
)
196 (declare (ignore var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
197 var-9 var-10 var-11 var-13 var-15 var-16
))
201 (if (> iflag
0) (go end_label
))
203 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
208 (f2cl-lib:fref y-%data%
210 ((1 (f2cl-lib:int-add n
1)))
213 (f2cl-lib:fref yp-%data%
215 ((1 (f2cl-lib:int-add n
1)))
217 (setf (f2cl-lib:fref work-%data%
218 ((f2cl-lib:int-sub
(f2cl-lib:int-add iw j
)
223 (f2cl-lib:int-add n
1))
224 (f2cl-lib:int-mul
2 n
)
228 (setf (f2cl-lib:fref work-%data%
229 ((f2cl-lib:int-sub
(f2cl-lib:int-add iz0 j
)
234 (f2cl-lib:int-add n
1))
235 (f2cl-lib:int-mul
2 n
)
240 (f2cl-lib:fdo
(judy 1 (f2cl-lib:int-add judy
1))
243 (setf rholen
(coerce -
1.0f0
'double-float
))
245 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
246 var-9 var-10 var-11 var-12 var-13 var-14 var-15 var-16
)
248 (f2cl-lib:array-slice work-%data%
257 (f2cl-lib:int-mul
2 n
)
260 (f2cl-lib:array-slice work-%data%
269 (f2cl-lib:int-mul
2 n
)
272 (f2cl-lib:array-slice work-%data%
281 (f2cl-lib:int-mul
2 n
)
284 ypold a qr lenqr pivot
285 (f2cl-lib:array-slice work-%data%
294 (f2cl-lib:int-mul
2 n
)
297 (f2cl-lib:array-slice work-%data%
306 (f2cl-lib:int-mul
2 n
)
309 (f2cl-lib:array-slice work-%data%
318 (f2cl-lib:int-mul
2 n
)
321 nfe n iflag par ipar
)
322 (declare (ignore var-1 var-2 var-3 var-4 var-5 var-6 var-7
323 var-8 var-9 var-10 var-11 var-13 var-15
328 (if (> iflag
0) (go end_label
))
330 (f2cl-lib:array-slice work-%data%
338 (f2cl-lib:int-mul
2 n
)
342 (f2cl-lib:array-slice work-%data%
350 (f2cl-lib:int-mul
2 n
)
359 (f2cl-lib:array-slice work-%data%
368 (f2cl-lib:int-mul
2 n
)
374 (f2cl-lib:array-slice work-%data%
383 (f2cl-lib:int-mul
2 n
)
387 (f2cl-lib:array-slice work-%data%
396 (f2cl-lib:int-mul
2 n
)
404 (f2cl-lib:array-slice work-%data%
413 (f2cl-lib:int-mul
2 n
)
418 (setf rcalc
(/ rholen rcalc
))))
422 (f2cl-lib:array-slice work-%data%
430 (f2cl-lib:int-mul
2 n
)
437 (f2cl-lib:array-slice work-%data%
446 (f2cl-lib:int-mul
2 n
)
454 ((<= h
(* fouru
(+ 1.0f0 s
)))
460 (setf fail f2cl-lib
:%false%
)
462 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
467 (f2cl-lib:fref yold-%data%
469 ((1 (f2cl-lib:int-add n
1)))
471 (f2cl-lib:fref ypold-%data%
473 ((1 (f2cl-lib:int-add n
1)))
475 (f2cl-lib:fref y-%data%
477 ((1 (f2cl-lib:int-add n
1)))
479 (f2cl-lib:fref yp-%data%
481 ((1 (f2cl-lib:int-add n
1)))
484 (setf (f2cl-lib:fref work-%data%
485 ((f2cl-lib:int-sub
(f2cl-lib:int-add iw j
)
490 (f2cl-lib:int-add n
1))
491 (f2cl-lib:int-mul
2 n
)
495 (setf (f2cl-lib:fref work-%data%
496 ((f2cl-lib:int-sub
(f2cl-lib:int-add iz0 j
)
501 (f2cl-lib:int-add n
1))
502 (f2cl-lib:int-mul
2 n
)
507 (f2cl-lib:fdo
(judy 1 (f2cl-lib:int-add judy
1))
510 (setf rholen
(coerce -
1.0f0
'double-float
))
512 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7 var-8
513 var-9 var-10 var-11 var-12 var-13 var-14 var-15 var-16
)
515 (f2cl-lib:array-slice work-%data%
524 (f2cl-lib:int-mul
2 n
)
527 (f2cl-lib:array-slice work-%data%
536 (f2cl-lib:int-mul
2 n
)
539 (f2cl-lib:array-slice work-%data%
548 (f2cl-lib:int-mul
2 n
)
552 (f2cl-lib:array-slice work-%data%
561 (f2cl-lib:int-mul
2 n
)
564 (f2cl-lib:array-slice work-%data%
573 (f2cl-lib:int-mul
2 n
)
576 (f2cl-lib:array-slice work-%data%
585 (f2cl-lib:int-mul
2 n
)
588 nfe n iflag par ipar
)
589 (declare (ignore var-1 var-2 var-3 var-4 var-5 var-6 var-7
590 var-8 var-9 var-10 var-11 var-13 var-15
595 (if (> iflag
0) (go end_label
))
597 (f2cl-lib:array-slice work-%data%
605 (f2cl-lib:int-mul
2 n
)
609 (f2cl-lib:array-slice work-%data%
617 (f2cl-lib:int-mul
2 n
)
626 (f2cl-lib:array-slice work-%data%
635 (f2cl-lib:int-mul
2 n
)
641 (f2cl-lib:array-slice work-%data%
650 (f2cl-lib:int-mul
2 n
)
654 (f2cl-lib:array-slice work-%data%
663 (f2cl-lib:int-mul
2 n
)
671 (f2cl-lib:array-slice work-%data%
680 (f2cl-lib:int-mul
2 n
)
685 (setf rcalc
(/ rholen rcalc
))))
689 (f2cl-lib:array-slice work-%data%
697 (f2cl-lib:int-mul
2 n
)
704 (f2cl-lib:array-slice work-%data%
713 (f2cl-lib:int-mul
2 n
)
720 (setf fail f2cl-lib
:%true%
)
723 ((<= h
(* fouru
(+ 1.0f0 s
)))
729 (dcopy np1 y
1 yold
1)
730 (dcopy np1 yp
1 ypold
1)
732 (f2cl-lib:array-slice work-%data%
738 (f2cl-lib:int-add n
1))
739 (f2cl-lib:int-mul
2 n
)
744 (f2cl-lib:array-slice work-%data%
750 (f2cl-lib:int-add n
1))
751 (f2cl-lib:int-mul
2 n
)
755 (daxpy np1 -
1.0 yold
1
756 (f2cl-lib:array-slice work-%data%
762 (f2cl-lib:int-add n
1))
763 (f2cl-lib:int-mul
2 n
)
769 (f2cl-lib:array-slice work-%data%
778 (f2cl-lib:int-mul
2 n
)
785 (f2cl-lib:array-slice work-%data%
791 (f2cl-lib:int-add n
1))
792 (f2cl-lib:int-mul
2 n
)
797 (f2cl-lib:array-slice work-%data%
803 (f2cl-lib:int-add n
1))
804 (f2cl-lib:int-mul
2 n
)
810 (f2cl-lib:array-slice work-%data%
819 (f2cl-lib:int-mul
2 n
)
827 (f2cl-lib:array-slice work-%data%
836 (f2cl-lib:int-mul
2 n
)
841 (if (= itnum
1) (setf lcalc
(coerce 0.0f0
'double-float
)))
843 ((= (+ lcalc rcalc dcalc
) 0.0f0
)
845 (* (f2cl-lib:fref sspar-%data%
(7) ((1 8)) sspar-%offset%
)
854 (f2cl-lib:fref sspar-%data%
859 (f2cl-lib:fref sspar-%data%
864 (f2cl-lib:fref sspar-%data%
869 (f2cl-lib:fref sspar-%data%
878 (f2cl-lib:fref sspar-%data%
883 (f2cl-lib:fref sspar-%data%
887 (* (f2cl-lib:fref sspar-%data%
(7) ((1 8)) sspar-%offset%
)
889 (f2cl-lib:fref sspar-%data%
(5) ((1 8)) sspar-%offset%
)))
892 (setf h
(max h hold
)))
894 (setf h
(min h hold
))))
895 (if fail
(setf h
(min h hfail
)))
922 (in-package #:cl-user
)
923 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
924 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
925 (setf (gethash 'fortran-to-lisp
::stepns
926 fortran-to-lisp
::*f2cl-function-info
*)
927 (fortran-to-lisp::make-f2cl-finfo
928 :arg-types
'((fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
929 (fortran-to-lisp::integer4
) fortran-to-lisp
::logical
930 fortran-to-lisp
::logical
(double-float) (double-float)
931 (double-float) (double-float) (double-float)
932 (array double-float
(*)) (array double-float
(*))
933 (array double-float
(*)) (array double-float
(*))
934 (array double-float
(*)) (array double-float
(*))
935 (fortran-to-lisp::integer4
)
936 (array fortran-to-lisp
::integer4
(*))
937 (array double-float
(*)) (array double-float
(*))
938 (array double-float
(*))
939 (array fortran-to-lisp
::integer4
(*)))
940 :return-values
'(nil fortran-to-lisp
::nfe fortran-to-lisp
::iflag
941 fortran-to-lisp
::start fortran-to-lisp
::crash
942 fortran-to-lisp
::hold fortran-to-lisp
::h
943 fortran-to-lisp
::relerr fortran-to-lisp
::abserr
944 fortran-to-lisp
::s nil nil nil nil nil nil nil nil
946 :calls
'(fortran-to-lisp::dcopy fortran-to-lisp
::daxpy
947 fortran-to-lisp
::dnrm2 fortran-to-lisp
::tangns
948 fortran-to-lisp
::d1mach
))))