Is there a better way to create a list of the imaginary parts of Zeta zeros than

Table[Im[ZetaZero[i]], {i, 1, 100}] ?

For values of the index greater than a few thousand the run-time is long. I think that it's the Im[ ] or Abs[ ] that burns the time, and the list without this compiles very quickly. I know there are upwards of 10M zeros programmed in, so hopefully there is a way to do this more efficiently.

  • $\begingroup$ (Shameless plug) In this paper here, the first 14400 ZetaZero's at precision 10000 are available for download. The notebook containing them can be downloaded at https://wolfr.am/mertens. $\endgroup$
    – Greg Hurst
    Jan 6, 2018 at 4:32

1 Answer 1

t0 = AbsoluteTime[];
Table[Im[N[ZetaZero[i]]], {i, 1, 1000}]
t1 = AbsoluteTime[];
d1 = N[t1 - t0]

on my computer, d1 is around 13.366 seconds.

t1 = AbsoluteTime[];
Im[Table[N[ZetaZero[i]], {i, 1, 1000}]]
t2 = AbsoluteTime[];
d2 = N[t2 - t1]

and d2 is 14.0818

t2 = AbsoluteTime[];
Im[ParallelTable[N[ZetaZero[i]], {i, 1, 1000}]]
t3 = AbsoluteTime[];
d3 = N[t3 - t2]

and d3 is 6.01491 seconds.

I suggest you use ParallelTable[] instead of Table[].

  • $\begingroup$ 14 seconds ia fine--but is there hope for i = 10000? $\endgroup$
    – daniel
    Jan 5, 2018 at 22:42
  • $\begingroup$ Again, on my computer (I mean it depends on your hardware and computational power like RAM, CPU, etc.) for 10000, it takes 131.558 second with Table[] and with ParallelTable[] it takes 41.1411 seconds. $\endgroup$ Jan 6, 2018 at 0:24
  • $\begingroup$ Rajil: Ah. My machine is much slower. Thanks. $\endgroup$
    – daniel
    Jan 6, 2018 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.