Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oct
oct
Commits
f203389e
Commit
f203389e
authored
Apr 10, 2012
by
Raymond Toy
Browse files
* Implement sum-big-ia.
* Add series for Bessel J. (Not working yet.)
parent
f8943af6
Changes
1
Hide whitespace changes
Inline
Side-by-side
qd-bessel.lisp
View file @
f203389e
...
...
@@ -324,8 +324,41 @@
(
incomplete-gamma-tail
a
(
*
theta
z
)))))
(
defun
sum-big-ia
(
big-n
v
z
)
)
(
let
((
big-n-1/2
(
+
big-n
1/2
))
(
eps
(
epsilon
z
)))
(
do*
((
n
0
(
1+
n
))
(
term
(
*
(
big-a
0
v
)
(
big-i
0
big-n-1/2
z
v
))
(
*
(
big-a
n
v
)
(
big-i
n
big-n-1/2
z
v
)))
(
sum
term
(
+
sum
term
)))
((
<=
(
abs
term
)
(
*
eps
(
abs
sum
)))
sum
)
#+
nil
(
progn
(
format
t
"n = ~D~%"
n
)
(
format
t
" term = ~S~%"
term
)
(
format
t
" sum = ~S~%"
sum
)))))
;; Series for bessel J:
;;
;; (z/2)^v*sum((-1)^k/Gamma(k+v+1)/k!*(z^2//4)^k, k, 0, inf)
(
defun
s-bessel-j
(
v
z
)
(
with-floating-point-contagion
(
v
z
)
(
let
((
z2/4
(
*
z
z
1/4
))
(
eps
(
epsilon
z
)))
(
do*
((
k
0
(
+
1
k
))
(
f
(
gamma
(
+
v
1
))
(
*
f
(
*
k
(
+
v
k
))))
(
term
(
/
f
)
(
/
(
*
(
-
term
)
z2/4
)
f
))
(
sum
term
(
+
sum
term
)))
((
<=
(
abs
term
)
(
*
eps
(
abs
sum
)))
(
*
sum
(
expt
(
*
z
1/2
)
v
)))
(
format
t
"k = ~D~%"
k
)
(
format
t
" term = ~S~%"
term
)
(
format
t
" sum = ~S~%"
sum
)))))
(
defun
bessel-j
(
v
z
)
(
let
((
vv
(
ftruncate
v
)))
(
cond
((
=
vv
v
)
...
...
@@ -338,7 +371,8 @@
(
*
z
(
/
(
sin
vpi
)
vpi
)
(
+
(
/
-1
z
)
(
sum-ab
big-n
v
z
)))))))))
(
sum-ab
big-n
v
z
)
(
sum-big-ia
big-n
v
z
)))))))))
(
defun
paris-series
(
v
z
n
)
(
labels
((
pochhammer
(
a
k
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment