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 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 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 ((res3la (make-array 3 :element-type
'double-float
))
34 (rlist2 (make-array 52 :element-type
'double-float
)) (extrap nil
)
35 (noext nil
) (id 0) (ierro 0) (iroff1 0) (iroff2 0) (iroff3 0)
36 (jupbnd 0) (k 0) (ksgn 0) (ktmin 0) (maxerr 0) (nres 0) (nrmax 0)
37 (numrl2 0) (abseps 0.0) (area 0.0) (area1 0.0) (area12 0.0)
38 (area2 0.0) (a1 0.0) (a2 0.0) (b1 0.0) (b2 0.0) (correc 0.0)
39 (defabs 0.0) (defab1 0.0) (defab2 0.0) (dres 0.0) (epmach 0.0)
40 (erlarg 0.0) (erlast 0.0) (errbnd 0.0) (errmax 0.0) (error1 0.0)
41 (error2 0.0) (erro12 0.0) (errsum 0.0) (ertest 0.0) (oflow 0.0)
42 (resabs 0.0) (reseps 0.0) (small 0.0) (uflow 0.0))
43 (declare (type (array double-float
(52)) rlist2
)
44 (type (array double-float
(3)) res3la
)
45 (type (double-float) uflow small reseps resabs oflow ertest
46 errsum erro12 error2 error1 errmax errbnd
47 erlast erlarg epmach dres defab2 defab1
48 defabs correc b2 b1 a2 a1 area2 area12
50 (type (f2cl-lib:integer4
) numrl2 nrmax nres maxerr ktmin ksgn k
51 jupbnd iroff3 iroff2 iroff1 ierro id
)
52 (type f2cl-lib
:logical noext extrap
))
53 (setf epmach
(f2cl-lib:d1mach
4))
59 (setf (f2cl-lib:fref alist-%data%
(1) ((1 *)) alist-%offset%
) a
)
60 (setf (f2cl-lib:fref blist-%data%
(1) ((1 *)) blist-%offset%
) b
)
61 (setf (f2cl-lib:fref rlist-%data%
(1) ((1 *)) rlist-%offset%
) 0.0)
62 (setf (f2cl-lib:fref elist-%data%
(1) ((1 *)) elist-%offset%
) 0.0)
63 (if (and (<= epsabs
0.0) (< epsrel
(max (* 50.0 epmach
) 5.0e-29)))
65 (if (= ier
6) (go label999
))
66 (setf uflow
(f2cl-lib:d1mach
1))
67 (setf oflow
(f2cl-lib:d1mach
2))
69 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
70 (dqk21 f a b result abserr defabs resabs
)
71 (declare (ignore var-0 var-1 var-2
))
76 (setf dres
(abs result
))
77 (setf errbnd
(max epsabs
(* epsrel dres
)))
79 (setf (f2cl-lib:fref rlist-%data%
(1) ((1 *)) rlist-%offset%
) result
)
80 (setf (f2cl-lib:fref elist-%data%
(1) ((1 *)) elist-%offset%
) abserr
)
81 (setf (f2cl-lib:fref iord-%data%
(1) ((1 *)) iord-%offset%
) 1)
82 (if (and (<= abserr
(* 100.0 epmach defabs
)) (> abserr errbnd
))
84 (if (= limit
1) (setf ier
1))
87 (and (<= abserr errbnd
) (/= abserr resabs
))
90 (setf (f2cl-lib:fref rlist2
(1) ((1 52))) result
)
100 (setf extrap f2cl-lib
:%false%
)
101 (setf noext f2cl-lib
:%false%
)
106 (if (>= dres
(* (- 1.0 (* 50.0 epmach
)) defabs
)) (setf ksgn
1))
107 (f2cl-lib:fdo
(last$
2 (f2cl-lib:int-add last$
1))
108 ((> last$ limit
) nil
)
111 (f2cl-lib:fref alist-%data%
(maxerr) ((1 *)) alist-%offset%
))
115 (f2cl-lib:fref alist-%data%
119 (f2cl-lib:fref blist-%data%
125 (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
))
127 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
128 (dqk21 f a1 b1 area1 error1 resabs defab1
)
129 (declare (ignore var-0 var-1 var-2
))
134 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
135 (dqk21 f a2 b2 area2 error2 resabs defab2
)
136 (declare (ignore var-0 var-1 var-2
))
141 (setf area12
(+ area1 area2
))
142 (setf erro12
(+ error1 error2
))
143 (setf errsum
(- (+ errsum erro12
) errmax
))
146 (f2cl-lib:fref rlist-%data%
150 (if (or (= defab1 error1
) (= defab2 error2
)) (go label15
))
155 (- (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
157 (* 1.0e-5 (abs area12
)))
158 (< erro12
(* 0.99 errmax
)))
160 (if extrap
(setf iroff2
(f2cl-lib:int-add iroff2
1)))
161 (if (not extrap
) (setf iroff1
(f2cl-lib:int-add iroff1
1)))
163 (if (and (> last$
10) (> erro12 errmax
))
164 (setf iroff3
(f2cl-lib:int-add iroff3
1)))
166 (setf (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
168 (setf (f2cl-lib:fref rlist-%data%
(last$
) ((1 *)) rlist-%offset%
)
170 (setf errbnd
(max epsabs
(* epsrel
(abs area
))))
171 (if (or (>= (f2cl-lib:int-add iroff1 iroff2
) 10) (>= iroff3
20))
173 (if (>= iroff2
5) (setf ierro
3))
174 (if (= last$ limit
) (setf ier
1))
176 (<= (max (abs a1
) (abs b2
))
177 (* (+ 1.0 (* 100.0 epmach
)) (+ (abs a2
) (* 1000.0 uflow
))))
179 (if (> error2 error1
) (go label20
))
180 (setf (f2cl-lib:fref alist-%data%
(last$
) ((1 *)) alist-%offset%
) a2
)
181 (setf (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
)
183 (setf (f2cl-lib:fref blist-%data%
(last$
) ((1 *)) blist-%offset%
) b2
)
184 (setf (f2cl-lib:fref elist-%data%
(maxerr) ((1 *)) elist-%offset%
)
186 (setf (f2cl-lib:fref elist-%data%
(last$
) ((1 *)) elist-%offset%
)
190 (setf (f2cl-lib:fref alist-%data%
(maxerr) ((1 *)) alist-%offset%
)
192 (setf (f2cl-lib:fref alist-%data%
(last$
) ((1 *)) alist-%offset%
) a1
)
193 (setf (f2cl-lib:fref blist-%data%
(last$
) ((1 *)) blist-%offset%
) b1
)
194 (setf (f2cl-lib:fref rlist-%data%
(maxerr) ((1 *)) rlist-%offset%
)
196 (setf (f2cl-lib:fref rlist-%data%
(last$
) ((1 *)) rlist-%offset%
)
198 (setf (f2cl-lib:fref elist-%data%
(maxerr) ((1 *)) elist-%offset%
)
200 (setf (f2cl-lib:fref elist-%data%
(last$
) ((1 *)) elist-%offset%
)
203 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5 var-6
)
204 (dqpsrt limit last$ maxerr errmax elist iord nrmax
)
205 (declare (ignore var-0 var-1 var-4 var-5
))
209 (if (<= errsum errbnd
) (go label115
))
210 (if (/= ier
0) (go label100
))
211 (if (= last$
2) (go label80
))
212 (if noext
(go label90
))
213 (setf erlarg
(- erlarg erlast
))
214 (if (> (abs (- b1 a1
)) small
) (setf erlarg
(+ erlarg erro12
)))
215 (if extrap
(go label40
))
219 (- (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
)
220 (f2cl-lib:fref alist-%data%
(maxerr) ((1 *)) alist-%offset%
)))
223 (setf extrap f2cl-lib
:%true%
)
226 (if (or (= ierro
3) (<= erlarg ertest
)) (go label60
))
229 (if (> last$
(+ 2 (the f2cl-lib
:integer4
(truncate limit
2))))
231 (f2cl-lib:int-sub
(f2cl-lib:int-add limit
3) last$
)))
232 (f2cl-lib:fdo
(k id
(f2cl-lib:int-add k
1))
236 (f2cl-lib:fref iord-%data%
241 (f2cl-lib:fref elist-%data%
249 (f2cl-lib:fref blist-%data%
(maxerr) ((1 *)) blist-%offset%
)
250 (f2cl-lib:fref alist-%data%
256 (setf nrmax
(f2cl-lib:int-add nrmax
1))
259 (setf numrl2
(f2cl-lib:int-add numrl2
1))
260 (setf (f2cl-lib:fref rlist2
(numrl2) ((1 52))) area
)
261 (multiple-value-bind (var-0 var-1 var-2 var-3 var-4 var-5
)
262 (dqelg numrl2 rlist2 reseps abseps res3la nres
)
263 (declare (ignore var-1 var-4
))
268 (setf ktmin
(f2cl-lib:int-add ktmin
1))
269 (if (and (> ktmin
5) (< abserr
(* 0.001 errsum
))) (setf ier
5))
270 (if (>= abseps abserr
) (go label70
))
275 (setf ertest
(max epsabs
(* epsrel
(abs reseps
))))
276 (if (<= abserr ertest
) (go label100
))
278 (if (= numrl2
1) (setf noext f2cl-lib
:%true%
))
279 (if (= ier
5) (go label100
))
280 (setf maxerr
(f2cl-lib:fref iord-%data%
(1) ((1 *)) iord-%offset%
))
282 (f2cl-lib:fref elist-%data%
(maxerr) ((1 *)) elist-%offset%
))
284 (setf extrap f2cl-lib
:%false%
)
285 (setf small
(* small
0.5))
289 (setf small
(* (abs (- b a
)) 0.375))
292 (setf (f2cl-lib:fref rlist2
(2) ((1 52))) area
)
295 (if (= abserr oflow
) (go label115
))
296 (if (= (f2cl-lib:int-add ier ierro
) 0) (go label110
))
297 (if (= ierro
3) (setf abserr
(+ abserr correc
)))
298 (if (= ier
0) (setf ier
3))
299 (if (and (/= result
0.0) (/= area
0.0)) (go label105
))
300 (if (> abserr errsum
) (go label115
))
301 (if (= area
0.0) (go label130
))
304 (if (> (/ abserr
(abs result
)) (/ errsum
(abs area
))) (go label115
))
306 (if (and (= ksgn -
1) (<= (max (abs result
) (abs area
)) (* defabs
0.01)))
309 (or (> 0.01 (/ result area
))
310 (> (/ result area
) 100.0)
311 (> errsum
(abs area
)))
316 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
321 (f2cl-lib:fref rlist-%data%
(k) ((1 *)) rlist-%offset%
)))
325 (if (> ier
2) (setf ier
(f2cl-lib:int-sub ier
1)))
327 (setf neval
(f2cl-lib:int-sub
(f2cl-lib:int-mul
42 last$
) 21))
349 (in-package #:cl-user
)
350 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
351 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
352 (setf (gethash 'fortran-to-lisp
::dqagse
353 fortran-to-lisp
::*f2cl-function-info
*)
354 (fortran-to-lisp::make-f2cl-finfo
355 :arg-types
'(t (double-float) (double-float) (double-float)
356 (double-float) (fortran-to-lisp::integer4
)
357 (double-float) (double-float)
358 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
359 (array double-float
(*)) (array double-float
(*))
360 (array double-float
(*)) (array double-float
(*))
361 (array fortran-to-lisp
::integer4
(*))
362 (fortran-to-lisp::integer4
))
363 :return-values
'(nil nil nil nil nil nil fortran-to-lisp
::result
364 fortran-to-lisp
::abserr fortran-to-lisp
::neval
365 fortran-to-lisp
::ier nil nil nil nil nil
366 fortran-to-lisp
::last$
)
367 :calls
'(fortran-to-lisp::dqelg fortran-to-lisp
::dqpsrt
368 fortran-to-lisp
::dqk21 fortran-to-lisp
::d1mach
))))