1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
3 ;;; "f2cl2.l,v 95098eb54f13 2013/04/01 00:45:16 toy $"
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 95098eb54f13 2013/04/01 00:45:16 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 1409c1352feb 2013/03/24 20:44:50 toy $")
10 ;;; Using Lisp CMU Common Lisp snapshot-2020-04 (21D Unicode)
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format double-float))
17 (in-package "HOMPACK")
36 (declare (type (f2cl-lib:integer4
) ic kount
)
37 (type (double-float) a acbs acmb ae cmb fa fb fc fx p q re tol u
))
38 (defun root (t$ ft b c relerr abserr iflag
)
39 (declare (type (f2cl-lib:integer4
) iflag
)
40 (type (double-float) abserr relerr c b ft t$
))
43 (if (>= iflag
0) (go label100
))
44 (setf iflag
(abs iflag
))
45 (f2cl-lib:computed-goto
(label200 label300 label400
) iflag
)
47 (setf u
(f2cl-lib:d1mach
4))
48 (setf re
(max relerr u
))
49 (setf ae
(max abserr
0.0))
51 (setf acbs
(abs (- b c
)))
65 (setf fx
(max (abs fb
) (abs fc
)))
67 (if (>= (abs fc
) (abs fb
)) (go label2
))
75 (setf cmb
(* 0.5f0
(- c b
)))
77 (setf tol
(+ (* re
(abs b
)) ae
))
78 (if (<= acmb tol
) (go label8
))
79 (if (>= kount
500) (go label12
))
80 (setf p
(* (- b a
) fb
))
82 (if (>= p
0.0f0
) (go label3
))
88 (setf ic
(f2cl-lib:int-add ic
1))
89 (if (< ic
4) (go label4
))
90 (if (>= (* 8.0f0 acmb
) acbs
) (go label6
))
94 (if (> p
(* (abs q
) tol
)) (go label5
))
95 (setf b
(+ b
(f2cl-lib:sign tol cmb
)))
98 (if (>= p
(* cmb q
)) (go label6
))
99 (setf b
(+ b
(/ p q
)))
102 (setf b
(* 0.5f0
(+ c b
)))
109 (if (= fb
0.0f0
) (go label9
))
110 (setf kount
(f2cl-lib:int-add kount
1))
111 (if (/= (f2cl-lib:sign
1.0 fb
) (f2cl-lib:sign
1.0 fc
)) (go label1
))
116 (if (= (f2cl-lib:sign
1.0 fb
) (f2cl-lib:sign
1.0 fc
)) (go label11
))
117 (if (> (abs fb
) fx
) (go label10
))
133 (return (values t$ nil b c nil nil iflag
)))))
135 (in-package #:cl-user
)
136 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
137 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
138 (setf (gethash 'fortran-to-lisp
::root fortran-to-lisp
::*f2cl-function-info
*)
139 (fortran-to-lisp::make-f2cl-finfo
140 :arg-types
'((double-float) (double-float) (double-float)
141 (double-float) (double-float) (double-float)
142 (fortran-to-lisp::integer4
))
143 :return-values
'(fortran-to-lisp::t$ nil fortran-to-lisp
::b
144 fortran-to-lisp
::c nil nil fortran-to-lisp
::iflag
)
145 :calls
'(fortran-to-lisp::d1mach
))))