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))
20 (let ((dpi 3.141592653589793) (dhpi 1.5707963267948966))
21 (declare (type (double-float) dpi dhpi
))
22 (defun zlog (ar ai br bi ierr
)
23 (declare (type (f2cl-lib:integer4
) ierr
) (type (double-float) bi br ai ar
))
24 (prog ((zm 0.0) (dtheta 0.0))
25 (declare (type (double-float) dtheta zm
))
27 (if (= ar
0.0) (go label10
))
28 (if (= ai
0.0) (go label20
))
29 (setf dtheta
(f2cl-lib:datan
(/ ai ar
)))
30 (if (<= dtheta
0.0) (go label40
))
31 (if (< ar
0.0) (setf dtheta
(- dtheta dpi
)))
34 (if (= ai
0.0) (go label60
))
36 (setf br
(f2cl-lib:flog
(abs ai
)))
37 (if (< ai
0.0) (setf bi
(- bi
)))
40 (if (> ar
0.0) (go label30
))
41 (setf br
(f2cl-lib:flog
(abs ar
)))
45 (setf br
(f2cl-lib:flog ar
))
49 (if (< ar
0.0) (setf dtheta
(+ dtheta dpi
)))
51 (setf zm
(coerce (realpart (zabs ar ai
)) 'double-float
))
52 (setf br
(f2cl-lib:flog zm
))
59 (return (values nil nil br bi ierr
)))))
61 (in-package #:cl-user
)
62 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
63 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
64 (setf (gethash 'fortran-to-lisp
::zlog fortran-to-lisp
::*f2cl-function-info
*)
65 (fortran-to-lisp::make-f2cl-finfo
66 :arg-types
'((double-float) (double-float) (double-float)
67 (double-float) (fortran-to-lisp::integer4
))
68 :return-values
'(nil nil fortran-to-lisp
::br fortran-to-lisp
::bi
69 fortran-to-lisp
::ierr
)
70 :calls
'(fortran-to-lisp::zabs
))))