(require "f2cl_macros") (defun zbrak (fx x1 x2 n xb1 xb2 nb) (declare (type double-float x1)) (declare (type double-float x2)) (declare (type fixnum n)) (declare (type (simple-array double-float (*)) xb1)) (declare (type (simple-array double-float (*)) xb2)) (declare (type fixnum nb)) (prog ((fc 0.0d0) (i 0) (fp 0.0d0) (dx 0.0d0) (x 0.0d0) (nbb 0)) (declare (type double-float fc)) (declare (type fixnum i)) (declare (type double-float fp)) (declare (type double-float dx)) (declare (type double-float x)) (declare (type fixnum nbb)) (setf nbb nb) (setf nb 0) (setf x x1) (setf dx (/ (+ x2 (- x1)) n)) (setf fp (funcall fx xy)) (fdo ((i 1 (+ i 1))) ((> i n) nil) (tagbody (setf x (+ x dx)) (setf fc (funcall fx x)) (cond ((< (* fc fp) 0.0) (setf nb (+ nb 1)) (fset (fref xb1 nb) (+ x (- dx))) (fset (fref xb2 nb) x) )) (setf fp fc) (if (= nbb nb) (go end_label)) )) (go end_label) end_label (return (values fx x1 x2 n xb1 xb2 nb)) ))