Use 1//2 instead of ((rat simp) 1 2)
[maxima.git] / src / numerical / slatec / dbesy1.lisp
blob9d9b3475565062916bbb19aaf87b75f7da0d1280
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)
11 ;;;
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))
17 (in-package :slatec)
20 (let ((nty1 0)
21 (xmin 0.0)
22 (xsml 0.0)
23 (by1cs
24 (make-array 20
25 :element-type 'double-float
26 :initial-contents '(0.032080471006119084 1.2627078974335004
27 0.006499961899923175
28 -0.08936164528860505
29 0.013250881221757096
30 -8.979059119648352e-4
31 3.647361487958307e-5
32 -1.0013743816660006e-6
33 1.994539657390174e-8
34 -3.023065601803382e-10
35 3.609878156947812e-12
36 -3.4874882972875824e-14
37 2.7838789715591767e-16
38 -1.8678709686194878e-18
39 1.0685315339116827e-20
40 -5.274721956684482e-23
41 2.2701994031556643e-25
42 -8.595390353945232e-28
43 2.8854043798337947e-30
44 -8.647541138937173e-33)))
45 (twodpi 0.6366197723675814)
46 (first$ nil))
47 (declare (type (f2cl-lib:integer4) nty1)
48 (type (double-float) xmin xsml twodpi)
49 (type (simple-array double-float (20)) by1cs)
50 (type f2cl-lib:logical first$))
51 (setq first$ f2cl-lib:%true%)
52 (defun dbesy1 (x)
53 (declare (type (double-float) x))
54 (prog ((ampl 0.0) (theta 0.0) (y 0.0) (dbesy1 0.0))
55 (declare (type (double-float) dbesy1 y theta ampl))
56 (cond
57 (first$
58 (setf nty1
59 (initds by1cs 20
60 (* 0.1f0 (f2cl-lib:freal (f2cl-lib:d1mach 3)))))
61 (setf xmin
62 (* 1.571
63 (exp
65 (max (f2cl-lib:flog (f2cl-lib:d1mach 1))
66 (- (f2cl-lib:flog (f2cl-lib:d1mach 2))))
67 0.01))))
68 (setf xsml (f2cl-lib:fsqrt (* 4.0 (f2cl-lib:d1mach 3))))))
69 (setf first$ f2cl-lib:%false%)
70 (if (<= x 0.0) (xermsg "SLATEC" "DBESY1" "X IS ZERO OR NEGATIVE" 1 2))
71 (if (> x 4.0) (go label20))
72 (if (< x xmin) (xermsg "SLATEC" "DBESY1" "X SO SMALL Y1 OVERFLOWS" 3 2))
73 (setf y 0.0)
74 (if (> x xsml) (setf y (* x x)))
75 (setf dbesy1
76 (+ (* twodpi (f2cl-lib:flog (* 0.5 x)) (dbesj1 x))
77 (/ (+ 0.5 (dcsevl (- (* 0.125 y) 1.0) by1cs nty1)) x)))
78 (go end_label)
79 label20
80 (multiple-value-bind (var-0 var-1 var-2)
81 (d9b1mp x ampl theta)
82 (declare (ignore var-0))
83 (setf ampl var-1)
84 (setf theta var-2))
85 (setf dbesy1 (* ampl (sin theta)))
86 (go end_label)
87 end_label
88 (return (values dbesy1 nil)))))
90 (in-package #:cl-user)
91 #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or))
92 (eval-when (:load-toplevel :compile-toplevel :execute)
93 (setf (gethash 'fortran-to-lisp::dbesy1
94 fortran-to-lisp::*f2cl-function-info*)
95 (fortran-to-lisp::make-f2cl-finfo :arg-types '((double-float))
96 :return-values '(nil)
97 :calls '(fortran-to-lisp::d9b1mp
98 fortran-to-lisp::dcsevl
99 fortran-to-lisp::dbesj1
100 fortran-to-lisp::xermsg
101 fortran-to-lisp::initds
102 fortran-to-lisp::d1mach))))