Re: computing Bernoulli numbers



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."
.



Relevant Pages

  • Re: computing Bernoulli numbers
    ... Bart Vandewoestyne wrote: ... end interface ... it looks like i'm switching from double precision ...
    (comp.lang.fortran)
  • Re: compiler switch -c
    ... All methods must be exposed by interface. ... module procedure fruit_summary_ ... end subroutine init_fruit_ ... character, intent, optional:: message ...
    (comp.lang.fortran)
  • TRANSFER arbitrary data ? (long)
    ... subroutine to minimize a function of n variables, ... end interface ... that to an integer array and back. ... subroutine minimize(Func, x, context) ...
    (comp.lang.fortran)
  • Re: Are procedure dummy arguments ignored in generic procedure resolution?
    ... the interface block that defines the ... recursive subroutine step_up ... Compiling program unit mykinds at line 1: ...
    (comp.lang.fortran)
  • Re: Error message from random number generation
    ... and then determine the Cholesky decomposition. ... subroutine that generates MVN values. ... Parameter 1 was incorrect on entry to vslDeleteStr ... Do you need an interface to ...
    (comp.lang.fortran)