home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / src / numerical / slatec / dbesi0.lisp < prev    next >
Encoding:
Text File  |  2003-02-09  |  2.8 KB  |  65 lines

  1. ;;; Compiled by f2cl version 2.0 beta 2002-05-06
  2. ;;; 
  3. ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
  4. ;;;           (:coerce-assigns :as-needed) (:array-type ':simple-array)
  5. ;;;           (:array-slicing nil) (:declare-common nil)
  6. ;;;           (:float-format double-float))
  7.  
  8. (in-package "SLATEC")
  9.  
  10.  
  11. (let ((nti0 0)
  12.       (xsml 0.0)
  13.       (xmax 0.0)
  14.       (bi0cs (make-array 18 :element-type 'double-float))
  15.       (first nil))
  16.   (declare (type f2cl-lib:logical first)
  17.            (type (simple-array double-float (18)) bi0cs)
  18.            (type double-float xmax xsml)
  19.            (type f2cl-lib:integer4 nti0))
  20.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (1) ((1 18))) -0.07660547252839145)
  21.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (2) ((1 18))) 1.9273379539938083)
  22.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (3) ((1 18))) 0.22826445869203013)
  23.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (4) ((1 18))) 0.013048914667072906)
  24.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (5) ((1 18))) 4.344270900816488e-4)
  25.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (6) ((1 18))) 9.422657686001936e-6)
  26.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (7) ((1 18))) 1.4340062895106911e-7)
  27.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (8) ((1 18))) 1.613849069661749e-9)
  28.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (9) ((1 18))) 1.39665004453567e-11)
  29.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (10) ((1 18))) 9.579451725505446e-14)
  30.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (11) ((1 18))) 5.333981859862503e-16)
  31.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (12) ((1 18))) 2.458716088437471e-18)
  32.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (13) ((1 18))) 9.53568089024877e-21)
  33.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (14) ((1 18))) 3.1543820397214273e-23)
  34.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (15) ((1 18))) 9.004564101094639e-26)
  35.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (16) ((1 18))) 2.2406473691236703e-28)
  36.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (17) ((1 18))) 4.903034603242837e-31)
  37.   (f2cl-lib:fset (f2cl-lib:fref bi0cs (18) ((1 18))) 9.508172606122669e-34)
  38.   (setq first f2cl-lib:%true%)
  39.   (defun dbesi0 (x)
  40.     (declare (type double-float x))
  41.     (prog ((y 0.0) (dbesi0 0.0))
  42.       (declare (type double-float dbesi0 y))
  43.       (cond
  44.        (first
  45.         (setf nti0
  46.                 (initds bi0cs 18
  47.                  (* 0.1f0 (f2cl-lib:freal (f2cl-lib:d1mach 3)))))
  48.         (setf xsml (f2cl-lib:fsqrt (* 4.5 (f2cl-lib:d1mach 3))))
  49.         (setf xmax (f2cl-lib:flog (f2cl-lib:d1mach 2)))))
  50.       (setf first f2cl-lib:%false%)
  51.       (setf y (coerce (abs x) 'double-float))
  52.       (if (> y 3.0) (go label20))
  53.       (setf dbesi0 1.0)
  54.       (if (> y xsml)
  55.           (setf dbesi0 (+ 2.75 (dcsevl (- (/ (* y y) 4.5) 1.0) bi0cs nti0))))
  56.       (go end_label)
  57.      label20
  58.       (if (> y xmax)
  59.           (xermsg "SLATEC" "DBESI0" "ABS(X) SO BIG I0 OVERFLOWS" 2 2))
  60.       (setf dbesi0 (* (exp y) (dbsi0e x)))
  61.       (go end_label)
  62.      end_label
  63.       (return (values dbesi0 nil)))))
  64.  
  65.