-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing the Riemann-Siegel Formula to find zeros of the Riemann Zeta Function with Roots.jl #186
Comments
Another "bad" approach would be to subdivide the native
The test sample of
correctly returns the first 100,000 zeros on the critical line. Although, this probably isn't the way you want to approach this computation. |
Thanks for opening this issue. First, let me note that rtsArray = roots(f, a, b) in rtsArray = roots(f, a .. b) Once you do that, this will still trigger an error, but that is related to the evaluation of julia> RiemennZ(1..2, 4)
ERROR: MethodError: no method matching RiemennZ(::Interval{Float64}, ::Int64) This is related to the fact that you have only defined a method for I hope this helps to continue on this. |
I was about to answer exactly that, but Luis beat me to it :) I have tried your example a bit further, and you will face another issue a bit further down the line. Name IntervalRootFinding will find no roots, because julia> RiemennZ(1..100, 4)
∅ This is because there seems to be a bug in IntervalArithmetic i.e. currently julia> (-1)^(-1..1)
∅ where it should return Even so, you will face other problem because now everything is replaced by intervals. In particular, I hope this helps you go forward. The bottomline is simply that if you want tu use intervals, you have to remember they are propagated to result in guaranteed computations. [1] Because it should probably error to be fair. |
I am interested in implementing a version of the Riemann-Siegel formula for calculating non-trivial zeros of the Riemann zeta function in Julia. I can "successfully" get "manually finding roots by stepping through an interval and looking for sign changes" to work. I can also "successfully" get find_zeros from the Roots.jl package to work (although, this is a "bad" approach for solving this problem and appears to auto-default to the Bisection method). This method might work better for this problem if one had access to other root-finding methods such as Brent's method.
However, I cannot seem to get roots.jl (from IntervalRootFinding) to work.The issue appears to be the way I pass through
rtsArray = roots(f, a, b)
on line 40 of the code below. Through looking at the example here, one can writef(x) = sin(x) - 0.1*x^2 + 1
and then
roots(f, -10..10)
which returns
I don't understand why I cannot do the same thing with
RiemennZ
(as is done infindRootsSlow
andfindRoots
in my code below). The second version of my code is pasted below.Uncommenting
findRootsIntervalArithmetic(a, b)
on line 288 returnsSo, I am likely doing something wrong on line 40 when I write
rtsArray = roots(f, a, b)
. I think that I have incorrectly called roots and this is expected to error out.The text was updated successfully, but these errors were encountered: