3 (defvar $brombergit
11)
4 (defvar $brombergmin
0)
5 (defvar $brombergtol
'((bigfloat simp
56.
) 59029581035870565. -
13.
)) ;1.b-4
6 (defvar $brombergabs
'((bigfloat simp
56.
) 0 0)) ; 0.0b0
11 (list (car x
) (+ (cadr x
) m
))))
14 (cond (($bfloatp
(setq x1
($bfloat
(meval x1
)))) (cdr x1
))
15 (t (displa x1
) (merror "bromberg: encountered a non-bigfloat."))))
20 (result (funcall f bf-x
)))
22 (merror "bromberg: integrand evaluates to a nonnumeric value at ~M" bf-x
)
25 (defun $bromberg
(&rest l1
)
26 (or (= (length l1
) 4) (= (length l1
) 3)
27 (merror "bromberg: wrong number of arguments."))
28 (let ((fun) (a) (b) (x)
31 (lim (cdr ($bfloat $brombergtol
)))
32 (limabs (cdr ($bfloat $brombergabs
)))
33 (tt (make-array $brombergit
))
34 (rr (make-array $brombergit
))
38 (declare (special $bfloat $float2bf
))
39 (cond ((= (length l1
) 4)
40 (when ($constantp
(cadr l1
))
42 "bromberg: variable of integration cannot be a constant; found ~M"
44 (setq fun
(coerce-bfloat-fun (car l1
) `((mlist) ,(cadr l1
)))
47 (setq fun
(coerce-bfloat-fun (car l1
)))))
48 (setq a
(bfmeval3 (cadr l1
))
49 b
(bfmeval3 (caddr l1
))
52 (fpscale (fptimes* x
(fpplus (bqeval3 fun b
)
55 (setf (aref rr
0) (fptimes* x
(bqeval3 fun
(fpscale (fpplus b a
) -
1))))
59 ((= l $brombergit
) (merror "bromberg: failed to converge."))
60 (setq y
(intofp m
) z
(fpquotient x y
))
62 (fpscale (fpplus (aref tt
(1- l
)) (aref rr
(1- l
))) -
1))
63 (setf (aref rr l
) zero
)
67 (fpplus (bqeval3 fun
(fpplus (fptimes* z
(intofp i
)) a
))
69 (setf (aref rr l
) (fpscale (fptimes* z
(aref rr l
)) 1))
73 (setq y
(fpplus (fpscale y
2) three
))
74 (setf (aref tt
(1- k
))
76 (fpdifference (aref tt k
) (aref tt
(1- k
)))
79 (setf (aref rr
(1- k
))
81 (fpdifference (aref rr k
) (aref rr
(1- k
)))
84 (setq y
(fpscale (fpplus (aref tt
0) (aref rr
0)) -
1))
90 (fpabs (fpdifference (aref tt
0)
95 (cond ((equal y
'(0 0)) one
)
98 (return (bcons y
))))))