# Questions tagged [implementation-details]

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

118 questions
Filter by
Sorted by
Tagged with
7k 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 ...
3k views

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

I'm curious what's inside the InterpolationFunction object? For example: ...
1k 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 ...
1k views

### What boundary is added when boundary condition is not sufficient?

When insufficient boundary conditions are given to NDSolve for solving PDE, usually the warning NDSolve::bcart pops up: ...
8k views

### How to find out which method Mathematica selected?

There are commands like NonlinearModelFit[] or NDSolve[] that have the option Method it ...
4k views

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

In order to solve a quite large system of differential equations, I have the habit to use the NDSolve command without changing any options. As I wanted more ...
1k 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 ...
2k 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: ...
2k 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, SubValues,...
1k views

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

I found something this tutorial for method of line doesn't tell us. Consider the following toy example: ...
1k views

### Symbolic derivatives are being calculated numerically

Update: (1) By V11, not sure of the exact version, the derivative IntegerPart' has been given a symbolic definition. (2) The numeric derivative computed has changed ...
5k 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 ...
2k views

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

This answer in which I wrote about the Operator Precedence Table was unexpectedly popular. That got me thinking about similar things, and I am wondering: Does an "ordering table" exist for the ...
708 views

### How does FunctionDomain work?

FunctionDomain[(x^2-x-2)/(x^2+x-6),x] gives x < -3 || -3 < x < 2 || x > 2. However, when I factor the ...
1k 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 ...
658 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 possible ...
7k 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 ...
479 views

### Evaluated vs. unevaluated Association

This question might have a remote connection to my older question, it is also about sameness of expressions and subtle differences observable only in certain forms. I encountered this strange ...
3k views

### Methods for NSolve

I've been using NSolve a moderate (50-100 equations) size system of linear equations and it has been working splendidly (Solve ...
2k 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: <...
552 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, ...
1k views

### What is the definition of Curl in Mathematica?

I have a usual mathematical background in vector and tensor calculus. I was trying to use the differential operators of Mathematica, namely Grad, ...
1 vote
223 views

### NIntegrate evaluates its 1st argument while it has the attribute HoldAll?

NIntegrate owns the attribute HoldAll: Attributes@NIntegrate (* {HoldAll, Protected} *) ...
2k 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, ...
6k views

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

For example, the colors used on this page: http://reference.wolfram.com/language/ref/ContourStyle.html or here: https://www.wolfram.com/mathematica/new-in-10/plot-themes/default.html or here: ...
4k views

### The difference between "SymbolicProcessing" -> 0 and restricting the function definition to numeric values only

The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
315 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  (...
3k 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 ...
681 views

### The default ColorFunction of DensityPlot before v10?

The default ColorFunction of Plot, Plot3D before v10 is respectively mentioned here and here,...
809 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 ...
248 views

### Does DegreeGraphDistribution sample uniformly?

Bug introduced in 10.0 or earlier and persisting through 12.1 The first symptom (histogram below) is gone in 12.0. The second (fraction of connected graphs) persists, showing that the sampling is ...
804 views

### how to take ImageFeatures?

I want to know how to transform images to feature vector. There is a function FeatureExtractor.And it has some methods. ...
230 views

### Pick bug? level 0 matching

A previous discussion of this issue (Is there a bug in Pick?) accepted that matching at level 0 is not a bug in Pick. Was that correct? I am not yet persuaded. ...
216 views

### Why NIntegrate is badly-behaved on $J_{\frac{9}{2}}(x)$ by default?

A friend of mine showed me this example: Plot[BesselJ[9/2, x], {x, 0, 1}, PlotLabel -> Style["The integrand seems to be simple", 14]] ...
811 views

### What is the default ColorFunction for MatrixPlot?

I think the the default ColorFunction for ArrayPlot is ColorNegate[RGBColor[{#, #, #}]] &...
7k 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 ...
665 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 ...
656 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 ...
617 views

### Why Except is so slow as compared to equivalent RegularExpression?

When comparing performance of the solutions suggested for this question I discovered that StringExpression involving Except is ...
528 views

### What can be inlined by "InlineExternalDefinitions" -> True?

This not-well-documented option of Compile has been used quite a bit in this site, and based on these examples, I used to think ...
2k 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 ...
2k 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: ...
577 views

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

Consider: Sin[Pi/5] which returns: $$\sqrt{\frac58-\frac{\sqrt5}{8}}$$ Does anyone know how to figure out the trigonometric identities used by Mathematica to ...
2k views

### What algorithms does NSolve use?

I've been using NSolve to find roots, and now I've been wondering what underlying algorithm Mathematica uses. It's probably similar to ...
582 views

### Finding NDSolve method details

I have eqs about the NDSolve, I know this code given the solving automatically. How can I find out what method is used behind the scenes? How can I gauge the ...
1k views

### Possible Method for MatrixExp

Well, probably a hard question, but I think it's better to cry out loud :). I noticed that MatrixExp has a Method option when ...
230 views

### Is NumberForm double rounding numbers?

A number like 0.644696875 is represented internally as 0.6446968749999...: N[FromDigits[RealDigits[0.644696875, 2], 2], \$MachinePrecision] (* 0.6446968749999999 *) ...
148 views

### What are the limits of the Prime-functions? [duplicate]

Will Prime and PrimePi test up to 3 * 10^12? Where can I find the limits for these funtions? ...