87 votes

What is the most convenient way to read definitions of in-memory symbols when we don't have the source files? (Spelunking tools)

In version 10.1, I've built something like Spelunk into GeneralUtilities`. To use it, run ...
user avatar
41 votes
Accepted

Where can I get detailed information on how the Plot command works?

I can add to Mr.Wizard's answer that when InputForm is wrapped by any head like List (...
user avatar
32 votes
Accepted

Why Except is so slow as compared to equivalent RegularExpression?

Using StringPattern`PatternConvert we can find the regexp into which Mathematica converts the original string expression: ...
user avatar
26 votes
Accepted

How was Mathematica built?

In the Mathematica book (5th edition), Stephen Wolfram writes the following (sec. 1.12.4): The Software Engineering of Mathematica Mathematica is one of the more complex software systems ever ...
user avatar
26 votes
Accepted

What's behind Method -> {"EquationSimplification" -> "Residual"}

This post contains several code blocks, you can copy them easily with the help of importCode. As mentioned in the comment above, the answer is hidden in this ...
user avatar
  • 52.5k
26 votes
Accepted

How was Nothing implemented?

Ok, I failed to find a duplicate so here is my comment: I don't know how Nothing is internally implemented but you can do something like this with ...
user avatar
  • 132k
25 votes
Accepted

What's the default colormap (or color scheme) used in mathematica?

"DefaultColorFunction" /. (Method/. Charting`ResolvePlotTheme[Automatic, ContourPlot]) "M10DefaultDensityGradient" ...
user avatar
  • 349k
24 votes
Accepted

How to know the internal algorithms of functions like Predict or Classify?

If you want to have a description of the method used by a given ClassifierFunction you can do: ...
user avatar
22 votes

Mathematica's morphological thinning algorithm

Prologue Some five years ago I have asked exactly this question to the Wolfram support people. Below I have taken their respective answers (one sentence for each ...
user avatar
  • 1,805
21 votes
Accepted

What algorithm do the Compress and Uncompress functions use?

It is using the zlib format followed by Base64 coding, and then preceding the resulting string with "1:". So to use it externally, you can strip the "1:", do Base64 decoding, and feed the result of ...
user avatar
  • 4,809
20 votes

What algorithm do the Compress and Uncompress functions use?

After a bit of poking around, it looks like the binary format is pretty simple to parse. Mark Adler's answer is correct - the strings Compress[] returns are just ...
user avatar
  • 613
20 votes
Accepted

What is the definition of Curl in Mathematica?

The definition used (motivated by exterior calculus) is as follows: Given a rectangular array $a$ of depth $n$, with dimensions $\{d, ..., d\}$ (so there are $n$ $d$'s) and a list $x = \{x_1, ..., ...
user avatar
  • 5,635
20 votes
Accepted

Why does setting SyntaxInformation add a definition to DefaultValues

In my view, the Mathematica front end would have needed a complete rewrite a long time ago to be in a shape where it can compete with modern UI's. Looking at MATLAB, it's clear that you always find ...
user avatar
  • 111k
19 votes
Accepted

What is behind experimental function: FindFormula?

The Experimental function FindFormula[] at the moment is using a combination of different methods: it combines non linear regression with Markov chain Monte Carlo ...
user avatar
  • 206
19 votes

NDSolve uses different difference order for different spatial derivative when solving PDE

Note: fix is broken since v11.3, a new question has been started aiming at upgrade it. Here's my approach for fixing the difference order. The key idea is ...
user avatar
  • 52.5k
18 votes

Is there a "precedence table" for the canonical Sort ordering?

So I think the docs are mostly clear, if hard to visualize. Here's my version of such a table: ...
user avatar
  • 45.5k
18 votes

How to determine BLAS/LAPACK implementation used internally for numerical matrix operations?

As indicated in the comments, machine-precision linear algebra operations in Mathematica use the Intel MKL library optimized implementation of BLAS/LAPACK. That is the case for all platforms where ...
user avatar
  • 25.1k
17 votes
Accepted

Why is FreeQ so much faster for some specific variable names?

TLDR: If you run into performance issues related to symbol names, rename your symbols such that System`Private`GetContentCode returns different values for each ...
user avatar
  • 7,666
17 votes

What's the principle behind the new MoleculeRecognize function?

Using ResourceFunction["PrintDefinitions"][MoleculeRecognize], one can determine that the source implementation is MolVec. The specific source code is: ...
user avatar
  • 12.6k
17 votes

How do the functions Reap and Sow actually work behind the scenes?

I do not know how Sow and Reap are actually implemented, but to show you that it isn't magic, I can provide the following toy ...
user avatar
16 votes

What algorithms does NSolve use?

In at least the univariate case, the guess of "Newton-Raphson" is not too far off. Daniel mentions the three possible methods supported by NSolve[]/...
user avatar
16 votes

How does Mathematica calculate $\sin(\pi/5)$?

In the course of answering this question, I ran into a little bit of weirdness that doesn't square with my experience with previous versions of Mathematica. I think writing this answer is as good a ...
user avatar
16 votes
Accepted

How does Mathematica solve a certain differential equation?

@Nasser's method seems to be what Mathematica does internally. The following gives hints of the steps taken, and one can see the elements of Nasser's solution. Some is left to the user to guess. The ...
user avatar
  • 216k
16 votes
Accepted

How does Mathematica calculate the Standard error during a non linear fit?

Rather than give formulas here is how to duplicate the results (coefficient estimates and standard errors) from NonlinearModelFit. First show the example from <...
user avatar
  • 34.1k
16 votes
Accepted

What stopwords list is the Wolfram language using?

A little spelunking of the code for DeleteStopwords[] yields the internally used stopword list: ...
user avatar
16 votes
Accepted

Evaluated vs. unevaluated Association

Summary The confusion we observe here is largely due to ambiguous use of the symbol Association as an expression head. On the one hand, ...
user avatar
  • 67k
15 votes

Where can I get detailed information on how the Plot command works?

As far as I know the specific output format of Plot (and similar commands) is not documented. I believe it has changed between versions therefore any post-...
user avatar
  • 264k
15 votes
Accepted

Show how Mathematica defines a function

This isn't necessarily how these functions are implemented, but MathematicalFunctionData gives a way to access definitions that are equivalent to the ones ...
user avatar
15 votes
Accepted

How does FunctionDomain work?

Evaluate ((x - 2) (x + 1))/((x - 2) (x + 3)) and see what it gives. It automatically simplifies to (1 + x)/(3 + x). The second ...
user avatar
  • 225k
15 votes

What stopwords list is the Wolfram language using?

The stop-words are documented and can be looked up as (see Details section of WordList): WordList["Stopwords"] As it might be ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible