Commit e10e402d by Raymond Toy

### Correct the computation of s-exp-integral-e when v is an integer. Add

tests.
parent 1d9ec007
 ... ... @@ -501,16 +501,14 @@ (- (* (/ (expt -z (- v 1)) (gamma v)) (- (psi v) (log z))) (loop for k from 0 below n for term = 1 then (* term (/ -z k)) for sum = (/ (- 1 v)) then (+ sum (/ term (+ k 1 -v))) when (< (abs term) (* (abs sum) eps)) return sum) (loop for k from n for term = 1 then (* term (/ -z k)) for sum = 0 then (+ sum (/ term (+ k 1 -v))) when (< (abs term) (* (abs sum) eps)) return sum))) (loop for k from 0 for term = 1 then (* term (/ -z k)) for sum = (/ (- 1 v)) then (+ sum (let ((denom (+ k 1 (- n)))) (if (zerop denom) 0 (/ term (+ k 1 -v))))) when (< (abs term) (* (abs sum) eps)) return sum))) (loop for k from 0 for term = 1 then (* term (/ -z k)) for sum = (/ (- 1 v)) then (+ sum (/ term (+ k 1 -v))) ... ...
 ... ... @@ -1464,3 +1464,17 @@ (expt x 4)))) (check-accuracy 210.8 e true)) nil) (rt:deftest expintegral-e.5d (let* ((x .5d0) (e (exp-integral-e 2d0 x)) (true #q0.3266438623245530177304015653336378358284946903290101)) (check-accuracy 51.2 e true)) nil) (rt:deftest expintegral-e.5q (let* ((x #q.5) (e (exp-integral-e #q2 x)) (true #q0.326643862324553017730401565333637835828494690329010198058745549181386569998611289568)) (check-accuracy 208.4 e true)) nil) \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!