For questions regarding the underlying implementation of built-in functions.

learn more… | top users | synonyms

66
votes
6answers
3k views

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

Note: I put Simon's implementation on GitHub. Contributions welcome! When trying to read the definition of already defined (package or built-in) symbols using ...
45
votes
2answers
969 views

How is pattern specificity decided?

Mathematica has a notion of pattern specificity, which is a partial ordering on patterns. The rules (e.g. DownValues, ...
43
votes
3answers
3k views

How to find out which method Mathematica selected?

There are commands like NonlinearModelFit[] or NDSolve[] that have the option Method it ...
41
votes
1answer
982 views

What's inside InterpolatingFunction[{{1., 4.}}, <>]?

I'm curious what's inside the InterpolationFunction object? For example: ...
34
votes
2answers
5k views

How does Interpolation really work?

I'm looking for some explanation or advice, not help in solving something. Recently I finished my program and my supervisor said "Ok, now it's time for your first paper: write a scientific text about ...
30
votes
1answer
780 views

What calendar is Mathematica using for dates in the distant past?

It appears that Mathematica treats all dates as proleptic Gregorian dates by default, a hypothesis that can be easily tested by using AbsoluteTime to compute the ...
29
votes
2answers
1k views

How does Plot work?

I considered the following function: sin[x_] := Module[{}, Print["x=", x]; Sin[x] ] in Mathematica. Next, I tried to plot it using: ...
29
votes
1answer
682 views

How are MemberQ and FreeQ so fast?

I would like to understand the implementation that allows MemberQ and FreeQ to be as fast as they are. I noticed this thanks to ...
28
votes
2answers
624 views

What is behind Mathematica's experimental `FindFormula` function?

In version 10.2 there is a new experimental function: FindFormula. I suspect that a genetic programming algorithm (symbolic regression) is behind this new feature ...
23
votes
1answer
496 views

Why does list assignment with a packed array result in unpacked values?

Bug introduced in 5.2 or earlier and fixed in 10.1.0 This is another question on the design choices in Mathematica. I understand that without direct reply from the developers it may not be ...
22
votes
2answers
502 views

How to implement FittedModel like objects

In the course of making some RLink wrappers I want to have some richer containers like Mathematica does with its FittedModel ...
22
votes
3answers
411 views

Efficiently appending points to a NearestFunction

I have a program which works with a list of points (in 3D, but it could be in 1D as well, it won't make a difference). Within a loop, it keeps adding new points to the list. To calculate the ...
21
votes
2answers
832 views

Blend code for built-in ColorData schemes

Hi I want to get a blend similar to "SunsetColors". To make those slight modifications, I would like to know the precise blend of that color scheme. My try: ...
21
votes
2answers
882 views

How to retrieve the parameters calculated and used by ImageAdjust?

When ImageAdjust is called with an image, i.e. with one parameter, it returns an automatically adjusted Image. I would like to ...
20
votes
1answer
475 views

Underlying Algorithms for List Manipulation Functions

Does anyone know, or know of a link for the underlying algorithms used for list manipulation functions? Specifically: Union with and without the ...
18
votes
1answer
616 views

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

Is there a command which reveals which implementation of BLAS and LAPACK are used in Mathematica's matrix operations such as Eigensystem? I asked a related question ...
17
votes
2answers
488 views

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

The command Plot[x^2, {x, -3, 3}, PlotStyle -> Arrowheads[{-.025, .025}]] /.Line -> Arrow produces this output. What I don't understand is what ...
16
votes
1answer
442 views

What does “suitable for symbolic manipulation” in the documentation mean?

This question is related to this other one I posted on Stack Overflow some time ago. There, in a beautiful answer, acl (with some unhumble editing done by me) showed that the derivative of ...
15
votes
2answers
482 views

Why does iterating Prime in reverse order require much more time?

Say I would like to display the $10$ greatest primes that are less than $10^5$. I could do the following: ...
15
votes
1answer
183 views

Why does't SeedRandom work here?

From the docs on SeedRandom, SeedRandom[] resets the generator, using as a seed the time of day and certain attributes of ...
14
votes
2answers
245 views

What algorithm do the Compress and Uncompress functions use?

Compress and Uncompress are used internally by Mathematica to compress things like 3D data in notebook files - data that I'd like to read independently. Does anyone have any idea if the compression ...
14
votes
1answer
1k views

What are the algorithm details of FindRoot?

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system". But I ...
14
votes
1answer
2k views

What method does NDSolve use for solving PDEs?

What is NDSolve's mode of operation? I use it to solve partial differential equations and never gave it too much thought. Recently, I came across this question. ...
14
votes
1answer
2k views

How does Mathematica integrate?

Basically, this question can be considered to be an extenstion to my other question. What I wanted to do was this integral as homework (it is indefinite BTW so no approximations using Simpson's Rule ...
14
votes
1answer
269 views

Why do big-O terms disappear in definite integrals since Mathematica 9?

In Mathematica 8, when I computed the following input: Integrate[Series[Cos[x], {x, 0, 2}], {x, 0, a}] Mathematica returned an expression that had a O[a^4] in ...
14
votes
1answer
438 views

What is the real default CellEvaluationFunction?

The default CellEvaluationFunction is Identity but one can quickly see that this is handled specially as an equivalent function, ...
12
votes
2answers
785 views

How does Mathematica determine that an evaluation should be terminated?

How exactly does Mathematica determine that evaluation of particular expression should be finished and the result should be returned? Here are some examples of unclear behavior which have arisen, ...
12
votes
1answer
342 views

What is the default ColorFunction for Image3D?

What is the default ColorFunction for Image3D? I find it a bit confusing that the most intense colour is not shown where the ...
12
votes
1answer
562 views

What function generates random numbers in a compiled function?

I am writing a simulation for 2D random walk. I wrote several version of code, and found that the speed is like this (fastest to slowest): C++, Mathematica compiled procedural code, Mathematica ...
11
votes
1answer
652 views

What type of solver does Mathematica use in LinearSolve

I have a question regarding linear equation solvers. For a specific 9-diagonal matrix, every method I tried in C++ (Gaus, GCC, BICGTAB) didn't work (even though they worked for other matrices). But in ...
10
votes
1answer
183 views

Algorithm used by IsomorphicGraphQ

I'd like to know which algorithm is used to test if two graphs are isomorphic?
10
votes
1answer
934 views

How does Mma compute Confidence Intervals?

I am trying to understand how Mma computes the Confidence Intervals after a NonlinearModelFit. Consider the following example: ...
10
votes
1answer
324 views

How does LocationTest choose its “AutomaticTest”?

Is there a way of determining how LocationTest chooses its "AutomaticTest"? Sometimes it's clear from the ...
9
votes
2answers
451 views

How to interpret the FullForm of a SparseArray?

SparseArrays are atomic objects, but they do have a FullForm which reveals information about them. What is the meaning of the ...
9
votes
1answer
383 views

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

The document centre seems only explain how to use these functions, but just in an very brief way. I know Mathmatica is not open source, so we can not expect to see the code of the function, but are ...
9
votes
3answers
650 views

The default bandwidth of the SmoothKernelDistribution function

I am researching the Silverman rule of thumb for bandwidth selection. Below is a sample of my code, from which it seems that BW=63 is close to the default parameter given by Mathematica (2 images are ...
9
votes
2answers
159 views

Does LinearSolve know that I gave it a Sparse lower triangular matrix?

Let $\mathbf L$ be a nonsingular numeric (non-symbolic) large, lower triangular sparse matrix. Let $\mathbf b$ be an appropriately sized vector. I want to solve $\mathbf L\mathbf x=\mathbf b$. ...
9
votes
1answer
307 views

What algorithm does Plot use to determine abscissas?

(I'm hoping this question is not hopelessly naive...) My understanding is that Plot's strategy is to generate a list of abscissas, evaluate the argument expression ...
9
votes
1answer
222 views

What are the hidden specifications for FindRoot

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system" (or a nonlinear equation I ...
9
votes
1answer
124 views

Why does $Failed have attribute HoldAll?

Why does $Failed have attribute HoldAll? Are there typical situations where $Failed is ...
9
votes
1answer
122 views

What is the simplest way to determine which call to a superfunction has generated a Message?

I have a complicated function which contains many calls to NIntegrate, NSolve, FindRoot and ...
9
votes
1answer
151 views

Apart may use Padé method: what's that?

How does Apart work? The page tutorial/SomeNotesOnInternalImplementation#7441 says, "Apart ...
9
votes
0answers
661 views

Does Mathematica use the Elliptic Curve Method (ECM) in FactorInteger[]?

I'm not a mathematician, and I'm not even going to pretend that I understand anything of the ECM. But I know it can be a fast method for factorization. I benchmarked the factorization of ...
8
votes
1answer
141 views

What values of $\delta$ and $\eta$ are being used in LatticeReduce?

The Lenstra–Lenstra–Lovász algorithm has a parameter $\delta$ with $1/4 < \delta < 1$, where roughly speaking the closer $\delta$ is to 1 the longer it takes, but the better basis reduction you ...
8
votes
1answer
332 views

How to check for Mathematica’s definition of XY?

The question is: Can I ask the Mathematica kernel directly what it takes as the definition of the built-in symbol XY? After all this has to be in the kernel. And if the documentation is not giving any ...
8
votes
1answer
246 views

Possible Method for MatrixExp

Well, probably a hard question, but I think it's better to cry out loud :). I noticed that MatrixExp owns Method option when ...
7
votes
2answers
284 views

Get name of hidden inbuilt functions (like Ticks drawing)

how do I get the name and definition of a builtin Mathematica functions? For instance, I would like to see how default Tick plotting function is implemented. However, it is not clear where it is and ...
7
votes
1answer
325 views

What algorithm is Mathematica 9 using for “SpectralEmbedding” of graphs?

When I specify that a graph should be realized using the "SpectralEmbedding" procedure, what paper / algorithm for spectral embedding is this based on? I was unable to find any documentation for ...
7
votes
1answer
2k views

Methods for NonlinearModelFit

I am using NonlinearModelFit for a thesis project. I get quite different results if I change the Method to LevenbergMarquardt or QuasiNewton or ConjugateGradient ...
7
votes
2answers
290 views

What is the underlying algorithm for GroupElementToWord?

What algorithm is Mathematica 9 using for GroupElementToWord[group, g]?