Re: computing Bernoulli numbers
- From: Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx>
- Date: Thu, 31 Jan 2008 15:50:55 GMT
On 2008-01-31, Michel Olagnon <molagnon@xxxxxxxxxxxxxxxxx> wrote:
What would you like to know/see more?
interface
function real_factorial(n) result(res)
integer(kind=i4b), intent(in) :: n
real(kind=qp) :: res
end function real_factorial
end interface
or even
external, real(kind=qp) :: real_factorial
bernoulli_series is a subroutine from my module mod_bernoulli.
In mod_bernoulli, I USE mod_utilities and in mod_utilities
real_factorial(n) is defined as I have previously copy-pasted it
in my message.
For as far as I know, due to the use of modules, i don't have to
declare real_factorial's interface explicitely anywhwere in
mod_bernoulli, right?
Does that give you the information you need?
I'm still puzzled about my accuracy loss. From what I read in
http://groups.google.be/group/sci.math.num-analysis/browse_thread/thread/88cab7bfaf115f6d/671edcdf8ebc5523?hl=nl&lnk=st&q=#671edcdf8ebc5523
the implementation based on Abramowitz and Stegun (23.2.16)
should be better than the one based on the recursion relation
that uses a sum of all prior Bernoulli numbers multiplied by some
binomial coefficients.
This is against what I experience... my A&S-implementation
performs worse than the one based on the recurrence :-(
Looking at the numbers I get and how they differ from what I
must expect, it looks like i'm switching from double precision
to single precision somewhere, but I do not see where that
happens in my code :-(
Bart
--
"Share what you know. Learn what you don't."
.
- Follow-Ups:
- Re: computing Bernoulli numbers
- From: Michel Olagnon
- Re: computing Bernoulli numbers
- From: dpb
- Re: computing Bernoulli numbers
- References:
- computing Bernoulli numbers
- From: Bart Vandewoestyne
- Re: computing Bernoulli numbers
- From: Michel Olagnon
- Re: computing Bernoulli numbers
- From: Bart Vandewoestyne
- Re: computing Bernoulli numbers
- From: Michel Olagnon
- computing Bernoulli numbers
- Prev by Date: Re: computing Bernoulli numbers
- Next by Date: Re: computing Bernoulli numbers
- Previous by thread: Re: computing Bernoulli numbers
- Next by thread: Re: computing Bernoulli numbers
- Index(es):
Relevant Pages
|
|