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 ':simple-array)
14 ;;; (:array-slicing nil) (:declare-common nil)
15 ;;; (:float-format double-float))
22 (pi$
3.14159265358979)
23 (rthpi 0.797884560802865)
27 :element-type
'double-float
28 :initial-contents
'(0.577215664901533 -
0.0420026350340952
29 -
0.0421977345555443 0.007218943246663
30 -
2.152416741149e-4 -
2.01348547807e-5
31 1.133027232e-6 6.116095e-9))))
32 (declare (type (double-float) x1 x2 pi$ rthpi hpi
)
33 (type (simple-array double-float
(8)) cc
))
34 (defun dbsynu (x fnu n y
)
35 (declare (type (simple-array double-float
(*)) y
)
36 (type (f2cl-lib:integer4
) n
)
37 (type (double-float) fnu x
))
38 (prog ((a (make-array 120 :element-type
'double-float
))
39 (rb (make-array 120 :element-type
'double-float
))
40 (cb (make-array 120 :element-type
'double-float
)) (ak 0.0) (arg 0.0)
41 (a1 0.0) (a2 0.0) (bk 0.0) (cbk 0.0) (cck 0.0) (ck 0.0) (coef 0.0)
42 (cpt 0.0) (cp1 0.0) (cp2 0.0) (cs 0.0) (cs1 0.0) (cs2 0.0) (cx 0.0)
43 (dnu 0.0) (dnu2 0.0) (etest 0.0) (etx 0.0) (f 0.0) (fc 0.0)
44 (fhs 0.0) (fk 0.0) (fks 0.0) (flrx 0.0) (fmu 0.0) (fn 0.0) (fx 0.0)
45 (g 0.0) (g1 0.0) (g2 0.0) (p 0.0) (pt 0.0) (q 0.0) (rbk 0.0)
46 (rck 0.0) (relb 0.0) (rpt 0.0) (rp1 0.0) (rp2 0.0) (rs 0.0)
47 (rs1 0.0) (rs2 0.0) (rx 0.0) (s 0.0) (sa 0.0) (sb 0.0) (smu 0.0)
48 (ss 0.0) (st 0.0) (s1 0.0) (s2 0.0) (tb 0.0) (tm 0.0) (tol 0.0)
49 (t1 0.0) (t2 0.0) (i 0) (inu 0) (j 0) (k 0) (kk 0) (nn 0))
50 (declare (type (f2cl-lib:integer4
) nn kk k j inu i
)
51 (type (double-float) t2 t1 tol tm tb s2 s1 st ss smu sb sa s rx
52 rs2 rs1 rs rp2 rp1 rpt relb rck rbk q pt p
53 g2 g1 g fx fn fmu flrx fks fk fhs fc f etx
54 etest dnu2 dnu cx cs2 cs1 cs cp2 cp1 cpt
55 coef ck cck cbk bk a2 a1 arg ak
)
56 (type (simple-array double-float
(120)) rb cb a
))
57 (setf ak
(f2cl-lib:d1mach
3))
58 (setf tol
(max ak
1.0e-15))
59 (if (<= x
0.0) (go label270
))
60 (if (< fnu
0.0) (go label280
))
61 (if (< n
1) (go label290
))
63 (setf inu
(f2cl-lib:int
(+ fnu
0.5)))
64 (setf dnu
(- fnu inu
))
65 (if (= (abs dnu
) 0.5) (go label260
))
67 (if (< (abs dnu
) tol
) (go label10
))
68 (setf dnu2
(* dnu dnu
))
70 (if (> x x1
) (go label120
))
73 (setf t1
(/ 1.0 (dgamma a1
)))
74 (setf t2
(/ 1.0 (dgamma a2
)))
75 (if (> (abs dnu
) 0.1) (go label40
))
76 (setf s
(f2cl-lib:fref cc
(1) ((1 8))))
78 (f2cl-lib:fdo
(k 2 (f2cl-lib:int-add k
1))
82 (setf tm
(* (f2cl-lib:fref cc
(k) ((1 8))) ak
))
84 (if (< (abs tm
) tol
) (go label30
))
90 (setf g1
(/ (- t1 t2
) dnu
))
95 (setf flrx
(f2cl-lib:flog rx
))
96 (setf fmu
(* dnu flrx
))
98 (if (= dnu
0.0) (go label60
))
99 (setf tm
(/ (sin (* dnu hpi
)) dnu
))
100 (setf tm
(* (+ dnu dnu
) tm tm
))
101 (setf fc
(/ dnu
(sin (* dnu pi$
))))
102 (if (/= fmu
0.0) (setf smu
(/ (sinh fmu
) fmu
)))
104 (setf f
(* fc
(+ (* g1
(cosh fmu
)) (* g2 flrx smu
))))
106 (setf p
(* fc t1 fx
))
107 (setf q
(/ (* fc t2
) fx
))
108 (setf g
(+ f
(* tm q
)))
114 (if (or (> inu
0) (> n
1)) (go label90
))
115 (if (< x tol
) (go label80
))
116 (setf cx
(* x x
0.25))
118 (setf f
(/ (+ (* ak f
) p q
) (- bk dnu2
)))
119 (setf p
(/ p
(- ak dnu
)))
120 (setf q
(/ q
(+ ak dnu
)))
121 (setf g
(+ f
(* tm q
)))
122 (setf ck
(/ (* (- ck
) cx
) ak
))
125 (setf bk
(+ bk ak ak
1.0))
127 (setf s
(/ (abs t1
) (+ 1.0 (abs s1
))))
128 (if (> s tol
) (go label70
))
130 (setf (f2cl-lib:fref y
(1) ((1 *))) (- s1
))
133 (if (< x tol
) (go label110
))
134 (setf cx
(* x x
0.25))
136 (setf f
(/ (+ (* ak f
) p q
) (- bk dnu2
)))
137 (setf p
(/ p
(- ak dnu
)))
138 (setf q
(/ q
(+ ak dnu
)))
139 (setf g
(+ f
(* tm q
)))
140 (setf ck
(/ (* (- ck
) cx
) ak
))
143 (setf t2
(* ck
(- p
(* ak g
))))
145 (setf bk
(+ bk ak ak
1.0))
147 (setf s
(+ (/ (abs t1
) (+ 1.0 (abs s1
))) (/ (abs t2
) (+ 1.0 (abs s2
)))))
148 (if (> s tol
) (go label100
))
150 (setf s2
(* (- s2
) rx
))
154 (setf coef
(/ rthpi
(f2cl-lib:fsqrt x
)))
155 (if (> x x2
) (go label210
))
156 (setf etest
(/ (cos (* pi$ dnu
)) (* pi$ x tol
)))
168 (setf k
(f2cl-lib:int-add k
1))
170 (setf ak
(/ (- fhs dnu2
) (+ fks fk
)))
172 (setf rbk
(/ rck pt
))
173 (setf cbk
(/ cck pt
))
176 (setf rp2
(- (* rbk rpt
) (* cbk cpt
) (* ak rp1
)))
177 (setf cp2
(- (+ (* cbk rpt
) (* rbk cpt
)) (* ak cp1
)))
180 (setf (f2cl-lib:fref rb
(k) ((1 120))) rbk
)
181 (setf (f2cl-lib:fref cb
(k) ((1 120))) cbk
)
182 (setf (f2cl-lib:fref a
(k) ((1 120))) ak
)
183 (setf rck
(+ rck
2.0))
184 (setf fks
(+ fks fk fk
1.0))
185 (setf fhs
(+ fhs fk fk
))
186 (setf pt
(max (abs rp1
) (abs cp1
)))
187 (setf fc
(+ (expt (/ rp1 pt
) 2) (expt (/ cp1 pt
) 2)))
188 (setf pt
(* pt
(f2cl-lib:fsqrt fc
) fk
))
189 (if (> etest pt
) (go label130
))
197 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
204 (- (* (f2cl-lib:fref rb
(kk) ((1 120))) rpt
)
205 (* (f2cl-lib:fref cb
(kk) ((1 120))) cpt
)
207 (f2cl-lib:fref a
(kk) ((1 120)))))
211 (+ (* (f2cl-lib:fref cb
(kk) ((1 120))) rpt
)
212 (* (f2cl-lib:fref rb
(kk) ((1 120))) cpt
))
214 (f2cl-lib:fref a
(kk) ((1 120)))))
219 (setf kk
(f2cl-lib:int-sub kk
1))
221 (setf pt
(max (abs rs
) (abs cs
)))
222 (setf fc
(+ (expt (/ rs pt
) 2) (expt (/ cs pt
) 2)))
223 (setf pt
(* pt
(f2cl-lib:fsqrt fc
)))
224 (setf rs1
(/ (+ (* rp2
(/ rs pt
)) (* cp2
(/ cs pt
))) pt
))
225 (setf cs1
(/ (- (* cp2
(/ rs pt
)) (* rp2
(/ cs pt
))) pt
))
226 (setf fc
(- (* hpi
(- dnu
0.5)) x
))
229 (setf s1
(* (- (* cs1 q
) (* rs1 p
)) coef
))
230 (if (or (> inu
0) (> n
1)) (go label150
))
231 (setf (f2cl-lib:fref y
(1) ((1 *))) s1
)
234 (setf pt
(max (abs rp2
) (abs cp2
)))
235 (setf fc
(+ (expt (/ rp2 pt
) 2) (expt (/ cp2 pt
) 2)))
236 (setf pt
(* pt
(f2cl-lib:fsqrt fc
)))
238 (+ dnu
0.5 (/ (- (+ (* rp1
(/ rp2 pt
)) (* cp1
(/ cp2 pt
)))) pt
)))
239 (setf cpt
(+ x
(/ (- (+ (* cp1
(/ rp2 pt
)) (* -
1 rp1
(/ cp2 pt
)))) pt
)))
240 (setf cs2
(- (* cs1 cpt
) (* rs1 rpt
)))
241 (setf rs2
(+ (* rpt cs1
) (* rs1 cpt
)))
242 (setf s2
(/ (* (+ (* rs2 q
) (* cs2 p
)) coef
) x
))
244 (setf ck
(/ (+ dnu dnu
2.0) x
))
245 (if (= n
1) (setf inu
(f2cl-lib:int-sub inu
1)))
246 (if (> inu
0) (go label170
))
247 (if (> n
1) (go label190
))
251 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
255 (setf s2
(- (* ck s2
) s1
))
259 (if (= n
1) (setf s1 s2
))
261 (setf (f2cl-lib:fref y
(1) ((1 *))) s1
)
262 (if (= n
1) (go end_label
))
263 (setf (f2cl-lib:fref y
(2) ((1 *))) s2
)
264 (if (= n
2) (go end_label
))
265 (f2cl-lib:fdo
(i 3 (f2cl-lib:int-add i
1))
268 (setf (f2cl-lib:fref y
(i) ((1 *)))
269 (- (* ck
(f2cl-lib:fref y
((f2cl-lib:int-sub i
1)) ((1 *))))
270 (f2cl-lib:fref y
((f2cl-lib:int-sub i
2)) ((1 *)))))
276 (if (and (= inu
0) (= n
1)) (setf nn
1))
277 (setf dnu2
(+ dnu dnu
))
279 (if (< (abs dnu2
) tol
) (go label220
))
280 (setf fmu
(* dnu2 dnu2
))
282 (setf arg
(- x
(* hpi
(+ dnu
0.5))))
286 (f2cl-lib:fdo
(k 1 (f2cl-lib:int-add k
1))
290 (setf t2
(/ (- fmu
1.0) etx
))
292 (setf relb
(* tol
(abs t2
)))
297 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
303 (setf t2
(/ (* (- t2
) (- fmu fn
)) t1
))
308 (setf t2
(/ (* t2
(- fmu fn
)) t1
))
310 (if (<= (abs t2
) relb
) (go label240
))
313 (setf s2
(* coef
(+ (* s sa
) (* ss sb
))))
314 (setf fmu
(+ fmu
(* 8.0 dnu
) 4.0))
319 (if (> nn
1) (go label160
))
323 (setf coef
(/ rthpi
(f2cl-lib:fsqrt x
)))
324 (setf s1
(* coef
(sin x
)))
325 (setf s2
(* (- coef
) (cos x
)))
328 (xermsg "SLATEC" "DBSYNU" "X NOT GREATER THAN ZERO" 2 1)
331 (xermsg "SLATEC" "DBSYNU" "FNU NOT ZERO OR POSITIVE" 2 1)
334 (xermsg "SLATEC" "DBSYNU" "N NOT GREATER THAN 0" 2 1)
337 (return (values nil nil nil nil
)))))
339 (in-package #:cl-user
)
340 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
341 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
342 (setf (gethash 'fortran-to-lisp
::dbsynu
343 fortran-to-lisp
::*f2cl-function-info
*)
344 (fortran-to-lisp::make-f2cl-finfo
345 :arg-types
'((double-float) (double-float)
346 (fortran-to-lisp::integer4
)
347 (simple-array double-float
(*)))
348 :return-values
'(nil nil nil nil
)
349 :calls
'(fortran-to-lisp::xermsg fortran-to-lisp
::dgamma
350 fortran-to-lisp
::d1mach
))))