Tag Info

New answers tagged

12

It's hard to know quite where to start with this, but I'd start with the answers to this question for some initial guidance. As a general guide, nested For loops are almost never necessary and using list-based operations is much more efficient, as well as readable and less prone to error. Let's take the inner loop first. For[h = 1, h <= 3, h = h + ...


3

Because the precision necessary to represent 18154980120849865. slightly exceeds, $MachinePrecision (* 15.9546 *) RiemannSiegelZ gives an inaccurate answer, RiemannSiegelZ[18154980120849865.] (* -0.563204 *) as compared with RiemannSiegelZ[SetPrecision[18154980120849865, 30] (* 1.22954136 *) and the same is true of the entire ListLinePlot shown in ...


5

Not an answer, but reporting a failed approach. I looked for asymptotic expansions of the zeta function for large arguments, thinking their evaluation might be faster. For instance, here The following took 100 s on my machine. Plot[ Re[(Exp[-((I (4 z^2 + Pi Sqrt[z^2]))/(8 z))] (z^2)^((I z)/4) Zeta[I z + 1/2])/(4^((I z)/4) Pi^((I z)/2))], {z, ...


2

A neater answer just uses Eigensystem: MapAt[Max, Eigensystem[m], {2, All}] // Transpose For input {{1, 2}, {3, 4}}, this returns {{1/2 (5 + Sqrt[33]), 1}, {1/2 (5 - Sqrt[33]), 1}}.


2

As long as you use Set (m =) rather than SetDelayed (m :=) the matrix will not be given new values unless you reevaluate the definition of m. SeedRandom[1]; Clear[m] m = RandomReal[{0, 1}, {2, 2}] {{0.817389, 0.11142}, {0.789526, 0.187803}} m {{0.817389, 0.11142}, {0.789526, 0.187803}} m {{0.817389, 0.11142}, {0.789526, 0.187803}} m ...


1

You can use list1 = {storagematrix[[i + 4]], storagematrix[[i + 5]]}; list2 = {a[[i]], a[[i + 1]]}; t=KroneckerProduct[list1, list2]; and Position[t,Min[t]] can obtain the indices of what you want to know about what product is less than others.



Top 50 recent answers are included