Linked Questions
10 questions linked to/from Why is Plus so much slower than Total?
117
votes
3answers
7k views
What is a Mathematica packed array?
A simple sounding question with a few sub questions:
What is the difference between unpacked vs packed array?
Are packed arrays more space efficent, how much so?
Are packed arrays more time ...
53
votes
3answers
2k views
Are there guidelines for avoiding the unpacking of a packed array?
Packed arrays are very useful because they save memory and generally allow speedier and more efficient calculation times. If a list of data currently stored as a packed array is unpacked, it can slow ...
15
votes
8answers
1k views
Product of elements of a list
Sum is for functions; Total is for a list. Product is for a function; what is the command ...
22
votes
3answers
3k views
Fastest way to measure Hamming distance of integers
I am looking for a fast and robust way to calculate the Hamming distance of integers. The Hamming distance of two integers is the number of matching bits in their binary representations. I expect that ...
17
votes
2answers
1k views
Why it seems that there is no counterpart function as to multiplication, to `Total` as to addition?
Times and Plus have the same grammar, and so do Product and ...
13
votes
3answers
605 views
The speed of Sum[] varies strangely
I was curious about the difference in speed between Total and Sum. I found out Total was ...
20
votes
2answers
576 views
Incorrect Timing of Total
For demonstrating how fast C-compiled functions can be, in one of my courses I use the following function for finding the sum of a list of reals:
...
8
votes
1answer
366 views
Why does taking advantage of Listable change the results of a numerical computation slightly?
I have two variables: t0, and teta0. The first is computed using several nested sums, the second is computed taking advantage to ...
12
votes
2answers
228 views
Last@Accumulate not giving same result as Total
If I run the code:
arr = Table[0.979, 249];
Last@Accumulate[arr] - Total[arr]
on Mathematica 11.0 (Windows), I get the result ...
16
votes
1answer
294 views
How does Plus work on machine precision Real arguments?
I thought Kahan's summation method would make a nice example for students to use to think about round-off error
[W. Kahan,
Pracniques: Further Remarks on Reducing Truncation Errors,
Commun. ACM 8 (...