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 ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format double-float))
21 (f a b c epsabs epsrel limit result abserr neval ier alist blist rlist
23 (declare (type (array f2cl-lib
:integer4
(*)) iord
)
24 (type (array double-float
(*)) elist rlist blist alist
)
25 (type (f2cl-lib:integer4
) last$ ier neval limit
)
26 (type (double-float) abserr result epsrel epsabs c b a
))
27 (f2cl-lib:with-multi-array-data
28 ((alist double-float alist-%data% alist-%offset%
)
29 (blist double-float blist-%data% blist-%offset%
)
30 (rlist double-float rlist-%data% rlist-%offset%
)
31 (elist double-float elist-%data% elist-%offset%
)
32 (iord f2cl-lib
:integer4 iord-%data% iord-%offset%
))
33 (prog ((iroff1 0) (iroff2 0) (k 0) (krule 0) (maxerr 0) (nev 0) (nrmax 0)
34 (aa 0.0) (area 0.0) (area1 0.0) (area12 0.0) (area2 0.0) (a1 0.0)
35 (a2 0.0) (bb 0.0) (b1 0.0) (b2 0.0) (epmach 0.0) (errbnd 0.0)
36 (errmax 0.0) (error1 0.0) (erro12 0.0) (error2 0.0) (errsum 0.0)
38 (declare (type (double-float) uflow errsum error2 erro12 error1 errmax
39 errbnd epmach b2 b1 bb a2 a1 area2 area12
41 (type (f2cl-lib:integer4
) nrmax nev maxerr krule k iroff2
43 (setf epmach
(f2cl-lib:d1mach
4))
44 (setf uflow
(f2cl-lib:d1mach
1))
48 (setf (f2cl-lib:fref alist-%data%
(1) ((1 *)) alist-%offset%
) a
)
49 (setf (f2cl-lib:fref blist-%data%
(1) ((1 *)) blist-%offset%
) b
)
50 (setf (f2cl-lib:fref rlist-%data%
(1) ((1 *)) rlist-%offset%
) 0.0)
51 (setf (f2cl-lib:fref elist-%data%
(1) ((1 *)) elist-%offset%
) 0.0)
52 (setf (f2cl-lib:fref iord-%data%
(1) ((1 *)) iord-%offset%
) 0)
58 (and (<= epsabs
0.0) (< epsrel
(max (* 50.0 epmach
) 5.0e-29))))
62 (if (<= a b
) (go label10
))
68 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
)
69 (dqc25c f aa bb c result abserr krule neval
)
70 (declare (ignore var-0 var-1 var-2
))
77 (setf (f2cl-lib:fref rlist-%data%
(1) ((1 *)) rlist-%offset%
) result
)
78 (setf (f2cl-lib:fref elist-%data%
(1) ((1 *)) elist-%offset%
) abserr
)
79 (setf (f2cl-lib:fref iord-%data%
(1) ((1 *)) iord-%offset%
) 1)
80 (setf (f2cl-lib:fref alist-%data%
(1) ((1 *)) alist-%offset%
) a
)
81 (setf (f2cl-lib:fref blist-%data%
(1) ((1 *)) blist-%offset%
) b
)
82 (setf errbnd
(max epsabs
(* epsrel
(abs result
))))
83 (if (= limit
1) (setf ier
1))
84 (if (or (< abserr
(min (* 0.01 (abs result
)) errbnd
)) (= ier
1))
86 (setf (f2cl-lib:fref alist-%data%
(1) ((1 *)) alist-%offset%
) aa
)
87 (setf (f2cl-lib:fref blist-%data%
(1) ((1 *)) blist-%offset%
) bb
)
88 (setf (f2cl-lib:fref rlist-%data%
(1) ((1 *)) rlist-%offset%
) result
)
96 (f2cl-lib:fdo
(last$
2 (f2cl-lib:int-add last$
1))
100 (f2cl-lib:fref alist-%data%
(maxerr) ((1 *)) alist-%offset%
))
104 (f2cl-lib:fref alist-%data%
108 (f2cl-lib:fref blist-%data%
113 (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
))
114 (if (and (<= c b1
) (> c a1
)) (setf b1
(* 0.5 (+ c b2
))))
115 (if (and (> c b1
) (< c b2
)) (setf b1
(* 0.5 (+ a1 c
))))
119 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
)
120 (dqc25c f a1 b1 c area1 error1 krule nev
)
121 (declare (ignore var-0 var-1 var-2
))
127 (setf neval
(f2cl-lib:int-add neval nev
))
129 (var-0 var-1 var-2 var-3 var-4 var-5 var-6 var-7
)
130 (dqc25c f a2 b2 c area2 error2 krule nev
)
131 (declare (ignore var-0 var-1 var-2
))
137 (setf neval
(f2cl-lib:int-add neval nev
))
138 (setf area12
(+ area1 area2
))
139 (setf erro12
(+ error1 error2
))
140 (setf errsum
(- (+ errsum erro12
) errmax
))
143 (f2cl-lib:fref rlist-%data%
151 (- (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
153 (* 1.0e-5 (abs area12
)))
154 (>= erro12
(* 0.99 errmax
))
156 (setf iroff1
(f2cl-lib:int-add iroff1
1)))
157 (if (and (> last$
10) (> erro12 errmax
) (= krule
0))
158 (setf iroff2
(f2cl-lib:int-add iroff2
1)))
159 (setf (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
161 (setf (f2cl-lib:fref rlist-%data%
(last$
) ((1 *)) rlist-%offset%
)
163 (setf errbnd
(max epsabs
(* epsrel
(abs area
))))
164 (if (<= errsum errbnd
) (go label15
))
165 (if (and (>= iroff1
6) (> iroff2
20)) (setf ier
2))
166 (if (= last$ limit
) (setf ier
1))
168 (<= (max (abs a1
) (abs b2
))
169 (* (+ 1.0 (* 100.0 epmach
)) (+ (abs a2
) (* 1000.0 uflow
))))
172 (if (> error2 error1
) (go label20
))
173 (setf (f2cl-lib:fref alist-%data%
(last$
) ((1 *)) alist-%offset%
) a2
)
174 (setf (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
)
176 (setf (f2cl-lib:fref blist-%data%
(last$
) ((1 *)) blist-%offset%
) b2
)
177 (setf (f2cl-lib:fref elist-%data%
(maxerr) ((1 *)) elist-%offset%
)
179 (setf (f2cl-lib:fref elist-%data%
(last$
) ((1 *)) elist-%offset%
)
183 (setf (f2cl-lib:fref alist-%data%
(maxerr) ((1 *)) alist-%offset%
)
185 (setf (f2cl-lib:fref alist-%data%
(last$
) ((1 *)) alist-%offset%
) a1
)
186 (setf (f2cl-lib:fref blist-%data%
(last$
) ((1 *)) blist-%offset%
) b1
)
187 (setf (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
189 (setf (f2cl-lib:fref rlist-%data%
(last$
) ((1 *)) rlist-%offset%
)
191 (setf (f2cl-lib:fref elist-%data%
(maxerr) ((1 *)) elist-%offset%
)
193 (setf (f2cl-lib:fref elist-%data%
(last$
) ((1 *)) elist-%offset%
)
196 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
197 (dqpsrt limit last$ maxerr errmax elist iord nrmax
)
198 (declare (ignore var-0 var-1 var-4 var-5
))
202 (if (or (/= ier
0) (<= errsum errbnd
)) (go label50
))
206 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
211 (f2cl-lib:fref rlist-%data%
(k) ((1 *)) rlist-%offset%
)))
215 (if (= aa b
) (setf result
(- result
)))
238 (in-package #:cl-user
)
239 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
240 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
241 (setf (gethash 'fortran-to-lisp
::dqawce
242 fortran-to-lisp
::*f2cl-function-info
*)
243 (fortran-to-lisp::make-f2cl-finfo
244 :arg-types
'(t (double-float) (double-float) (double-float)
245 (double-float) (double-float)
246 (fortran-to-lisp::integer4
) (double-float)
247 (double-float) (fortran-to-lisp::integer4
)
248 (fortran-to-lisp::integer4
) (array double-float
(*))
249 (array double-float
(*)) (array double-float
(*))
250 (array double-float
(*))
251 (array fortran-to-lisp
::integer4
(*))
252 (fortran-to-lisp::integer4
))
253 :return-values
'(nil nil nil fortran-to-lisp
::c nil nil nil
254 fortran-to-lisp
::result fortran-to-lisp
::abserr
255 fortran-to-lisp
::neval fortran-to-lisp
::ier nil nil
256 nil nil nil fortran-to-lisp
::last$
)
257 :calls
'(fortran-to-lisp::dqpsrt fortran-to-lisp
::dqc25c
258 fortran-to-lisp
::d1mach
))))