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 ((drt 0.7071067811865476) (dpi 3.141592653589793))
21 (declare (type (double-float) drt dpi
))
22 (defun zsqrt$
(ar ai br bi
)
23 (declare (type (double-float) bi br ai ar
))
24 (prog ((zm 0.0) (dtheta 0.0))
25 (declare (type (double-float) dtheta zm
))
26 (setf zm
(coerce (realpart (zabs ar ai
)) 'double-float
))
27 (setf zm
(f2cl-lib:fsqrt zm
))
28 (if (= ar
0.0) (go label10
))
29 (if (= ai
0.0) (go label20
))
30 (setf dtheta
(f2cl-lib:datan
(/ ai ar
)))
31 (if (<= dtheta
0.0) (go label40
))
32 (if (< ar
0.0) (setf dtheta
(- dtheta dpi
)))
35 (if (> ai
0.0) (go label60
))
36 (if (< ai
0.0) (go label70
))
41 (if (> ar
0.0) (go label30
))
43 (setf bi
(f2cl-lib:fsqrt
(abs ar
)))
46 (setf br
(f2cl-lib:fsqrt ar
))
50 (if (< ar
0.0) (setf dtheta
(+ dtheta dpi
)))
52 (setf dtheta
(* dtheta
0.5))
53 (setf br
(* zm
(cos dtheta
)))
54 (setf bi
(* zm
(sin dtheta
)))
62 (setf bi
(* (- zm
) drt
))
65 (return (values nil nil br bi
)))))
67 (in-package #:cl-user
)
68 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
69 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
70 (setf (gethash 'fortran-to-lisp
::zsqrt$
71 fortran-to-lisp
::*f2cl-function-info
*)
72 (fortran-to-lisp::make-f2cl-finfo
73 :arg-types
'((double-float) (double-float) (double-float)
75 :return-values
'(nil nil fortran-to-lisp
::br fortran-to-lisp
::bi
)
76 :calls
'(fortran-to-lisp::zabs
))))