Changeset f20338 for qdbessel.lisp
 Timestamp:
 04/10/12 07:45:13 (3 years ago)
 Branches:
 master
 Children:
 e9cd1a
 Parents:
 f8943a
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

qdbessel.lisp
rc7fc98 rf20338 325 325 326 326 (defun sumbigia (bign v z) 327 ) 328 327 (let ((bign1/2 (+ bign 1/2)) 328 (eps (epsilon z))) 329 (do* ((n 0 (1+ n)) 330 (term (* (biga 0 v) 331 (bigi 0 bign1/2 z v)) 332 (* (biga n v) 333 (bigi n bign1/2 z v))) 334 (sum term (+ sum term))) 335 ((<= (abs term) (* eps (abs sum))) 336 sum) 337 #+nil 338 (progn 339 (format t "n = ~D~%" n) 340 (format t " term = ~S~%" term) 341 (format t " sum = ~S~%" sum))))) 342 343 ;; Series for bessel J: 344 ;; 345 ;; (z/2)^v*sum((1)^k/Gamma(k+v+1)/k!*(z^2//4)^k, k, 0, inf) 346 (defun sbesselj (v z) 347 (withfloatingpointcontagion (v z) 348 (let ((z2/4 (* z z 1/4)) 349 (eps (epsilon z))) 350 (do* ((k 0 (+ 1 k)) 351 (f (gamma (+ v 1)) 352 (* f (* k (+ v k)))) 353 (term (/ f) 354 (/ (* ( term) z2/4) f)) 355 (sum term (+ sum term))) 356 ((<= (abs term) (* eps (abs sum))) 357 (* sum (expt (* z 1/2) v))) 358 (format t "k = ~D~%" k) 359 (format t " term = ~S~%" term) 360 (format t " sum = ~S~%" sum))))) 361 329 362 (defun besselj (v z) 330 363 (let ((vv (ftruncate v))) … … 339 372 (/ (sin vpi) vpi) 340 373 (+ (/ 1 z) 341 (sumab bign v z))))))))) 374 (sumab bign v z) 375 (sumbigia bign v z))))))))) 342 376 343 377
Note: See TracChangeset
for help on using the changeset viewer.