Skip to main content
23 events
when toggle format what by license comment
Sep 26, 2021 at 16:47 history edited Stefan Kohl
edited tags
Sep 26, 2021 at 16:45 history made wiki Post Made Community Wiki by Stefan Kohl
Sep 22, 2011 at 21:19 comment added Sridhar Ramesh @brianjd: I see (I was thrown by the mention of vectors, though I should've seen your earlier clarification). In that case, it's surely simply for the same reason that x^2 can be slower than x * x for single element calculations: the general procedure to compute x^y with arbitrary (possibly even non-integral) exponent y is presumably rather slower than the procedure to simply multiply two values (this latter operation probably being particularly primitively implemented in hardware).
Sep 22, 2011 at 8:13 comment added Suvrit Rule of Thumb #1: Don't depend on rules-of-thumb!
Sep 22, 2011 at 3:59 comment added lowndrul @Will. Fair. I see in the first line of the FAQ that this is for "research level math questions". I wouldn't have asked my question here if I'd read that first. Thank you for the pointer.
Sep 22, 2011 at 2:59 comment added Will Jagy Given that your questions seem to be at an undergraduate mathematics level, you would have a better experience at math.stackexchange.com/questions where such questions fit well. This is an elitist site in that it is for researchers in mathematics itself. If you ever get interested, the Pratchett book is quite good.
Sep 22, 2011 at 2:38 comment added lowndrul ...I was not asking anyone to be a slave. Maybe answers would have been too system-idiosyncratic and closing the question was the reasonable thing to do. But I don't think my question was a priori unreasonable. I may be reading some of these responses wrong, but they give me the feeling that academic elitism is alive and well here.
Sep 22, 2011 at 2:26 comment added lowndrul Thanks to those providing constructive feedback. I have to admit I'm bothered by some of the responses though. I suppose there's no substitute for knowing set theory, but we go ahead and learn to count. I suppose there's no substitute for knowing how the internal combustion engine works, but we go ahead and drive cars. Sure, knowing numerical analysis would improve my programming greatly, but I was inquiring about a few basic rules-of-thumb that would improve it marginally. I provided a couple examples that, for me, helped serve that end. I thought others might have some as well...
Sep 22, 2011 at 0:14 comment added Will Jagy in case anyone wonders, from "Small Gods" by Terry Pratchett, page 208 in a paperback edition of 344 pages.
Sep 21, 2011 at 20:45 comment added Will Jagy "...old Prince Lasgere of Tsort asked me how he could become learned, especially since he hadn't got any time for this reading business. I said to him There is no royal road to learning, sire' and he said to me Bloody well build one or I shall have your legs chopped off. Use as many slaves as you like.' A refreshingly direct approach, I always thought. Not a man to mince words. People, yes. But not words."
Sep 21, 2011 at 20:41 history closed Igor Rivin
Suvrit
Gerald Edgar
Bruce Westbury
Will Jagy
not a real question
Sep 21, 2011 at 18:54 comment added Igor Rivin @brianjd: yes, R on StackOverflow, Mathematica on StackOverflow, Maple on StackOverflow, Macsyma on StackOverflow, MuPad on StackOverflow, Matlab on StackOverflow....
Sep 21, 2011 at 18:51 comment added lowndrul So maybe I should ask this specifically for, say, R over on the StackOverflow board?
Sep 21, 2011 at 18:50 comment added lowndrul @Sridhar. It's not a dot product. It's element-wise multiplication.
Sep 21, 2011 at 18:25 comment added Sridhar Ramesh I suspect item 1 means "Compute x DOT x, instead of |x|^2", and that the reason this is faster is that the computation of |x| proceeds by computing sqrt(x DOT x)...
Sep 21, 2011 at 17:14 comment added Federico Poloni I am afraid the answer is "No, you really have to take at least that basic course in numerical analysis, or at least browse a book on the subject".
Sep 21, 2011 at 16:33 comment added Suvrit Yes, this is actually too broad as Igor points out. Even though rules of thumb encode a compressed version of wisdom and experience acquired over the years, they are no substitute for system (architecture, hardware, etc.) and algorithm specific tuning.
Sep 21, 2011 at 16:27 comment added Igor Rivin This question is much too broad (every software system is different, and there are a LOT of these...), so I am voting to close until this is big-list/community-wiki
Sep 21, 2011 at 16:16 history edited lowndrul CC BY-SA 3.0
added 6 characters in body
Sep 21, 2011 at 16:14 comment added lowndrul @Henry: e.g., in R, even though x^2 and x*x return the same, length-n vector, the former is computationally more burdensome.
Sep 21, 2011 at 16:09 comment added Henry Cohn What do you mean by the first example (computing $x*x$ instead of $x^2$ for a large numerical vector $x$)?
Sep 21, 2011 at 15:31 history edited lowndrul CC BY-SA 3.0
added 176 characters in body
Sep 21, 2011 at 15:24 history asked lowndrul CC BY-SA 3.0