To Jezebel

J

JBNewsGroup

Hi Jezebel,

<< That's elegant. Any suggestions for the Riemann zeta function? >>

You really made me hit the books on this one. I had to go to the
http://mathworld.wolfram.com/RiemannZetaFunction.html site to read about it.
First off you must be a "math person" to be doing this kind of work on a PC
without FORTRAN. I know of no "elegant" way to program the function. The
only suggestion I have is to program the 1/k function as a series. Try
not to use exponentiation as it is the slowest computer math algorithm.
Series are easy to implement and usually involve multiplication, and some
division, with is way faster than exponentiation.

There is a good book for numerical methods for computers and I usually hit
this book first. It is geared towards FORTRAN but I have found that it is
relatively easy to translate to other languages (they give some flowcharts).
If you can find it the book is: "Applied Numerical Methods for Digital
Computation With FORTRAN" by M. L. James, G. M. Smith and J. C. Wolford. My
copy is from 1967 (dating myself) but math doesn't change.

If you wish, post your code and I will look it over to see if I can simplify
it, or make it more efficient.

Jerry Bodoff
 
J

JBNewsGroup

Hi Jezebel,

Forgot to add this which is my idea for calculating the sum:

Dim ZetaSum As Variant
ZetaSum = 0#
For K = 1 To N
ZetaSum = ZetaSum + SeriesFunction(K, N)
Next K

Private Function SeriesFunction(K As Long, N As Long) As Variant
SeriesFunction = --- Fourier series for 1/k to the n power ---
End Function

I put the series calculation in a Function to make the loop less "cluttered"
and Variants for floating point.

Jerry B
 
J

Jay Freedman

By the way, just to make your work more interesting, both the input variable
and the output value of the Riemann zeta function are complex numbers... not
something I'd want to program in VBA. Maybe in APL.
 
J

Jezebel

They don't *have* to be complex numbers. But the function is interesting
only if they are.
 
J

JBNewsGroup

Hi Jay,

This thread is getting interesting but it is off the beaten path. Anyways,
I would prefer to program something like this in FORTRAN. However, I worked
on a TANDEM mainframe in which the COBOL language had a package for math and
statistics. Try doing this in COBOL.

Jerry B
 
J

Jezebel

There's a website somewhere that has a java implementation: you can watch
the function unfold in front of you. Fascinating way to waste time.
 
J

JBNewsGroup

Hi Jezebel,

I saw that site when I was looking for info about the function.

Jerry B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top