Changeset d80256 for qd-gamma.lisp


Ignore:
Timestamp:
03/23/12 20:00:24 (3 years ago)
Author:
Raymond Toy <rtoy@…>
Branches:
master
Children:
41f1ca
Parents:
b1ae69
Message:

Need to apply contagion for exp-integral-e.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qd-gamma.lisp

    rb1ae69 rd80256  
    529529  ;;
    530530  ;;
    531   (cond ((and (realp v) (minusp v))
    532          ;; E(-v, z) = z^(-v-1)*incomplete_gamma_tail(v+1,z)
    533          (let ((-v (- v)))
     531  (let* ((prec (float-contagion v z))
     532         (v (apply-contagion v prec))
     533         (z (apply-contagion z prec)))
     534    (cond ((and (realp v) (minusp v))
     535           ;; E(-v, z) = z^(-v-1)*incomplete_gamma_tail(v+1,z)
     536           (let ((-v (- v)))
     537             (* (expt z (- v 1))
     538                (incomplete-gamma-tail (+ -v 1) z))))
     539          ((< (abs z) 1)
     540           ;; Use series for small z
     541           (s-exp-integral-e v z))
     542          ((>= (abs (phase z)) 3.1)
     543           ;; The continued fraction doesn't converge on the negative
     544           ;; real axis, and converges very slowly near the negative
     545           ;; real axis, so use the incomplete-gamma-tail function in
     546           ;; this region.  "Closeness" to the negative real axis is
     547           ;; teken to mean that z is in a sector near the axis.
     548           ;;
     549           ;; E(v,z) = z^(v-1)*incomplete_gamma_tail(1-v,z)
    534550           (* (expt z (- v 1))
    535               (incomplete-gamma-tail (+ -v 1) z))))
    536         ((< (abs z) 1)
    537          ;; Use series for small z
    538          (s-exp-integral-e v z))
    539         ((>= (abs (phase z)) 3.1)
    540          ;; The continued fraction doesn't converge on the negative
    541          ;; real axis, and converges very slowly near the negative
    542          ;; real axis, so use the incomplete-gamma-tail function in
    543          ;; this region.  "Closeness" to the negative real axis is
    544          ;; teken to mean that z is in a sector near the axis.
    545          ;;
    546          ;; E(v,z) = z^(v-1)*incomplete_gamma_tail(1-v,z)
    547          (* (expt z (- v 1))
    548             (incomplete-gamma-tail (- 1 v) z)))
    549         (t
    550          ;; Use continued fraction for everything else.
    551          (cf-exp-integral-e v z))))
     551              (incomplete-gamma-tail (- 1 v) z)))
     552          (t
     553           ;; Use continued fraction for everything else.
     554           (cf-exp-integral-e v z)))))
    552555
    553556;; Series for Fresnel S
Note: See TracChangeset for help on using the changeset viewer.