739 views

### Memoization of a function defined by a recurrence relation [duplicate]

I have a function which is defined by the following recurrence relation $$h_{n}(x)=h_{n-1}(x)+\frac{\mathrm{e}^{-x^2}}{2^n n!}H_{n}(x)H_{n-1}(x)$$ with the initial condition $h_{0}(x)=0$ and where the ...
• 41
55 views

### Keeping memory to reduce the running time of recursion [duplicate]

I am using the following recursion in Mathematica to compute W[n, 1, s] for given n and s: ...
21 views

### How to memoize with patterns? [duplicate]

Here is an artificial example to explain what I am up to. Define ClearAll[f] f[x_, y_] := f[x, y] = If[x == 0, g[y], g[f[x - 1, y]]] Then ...
• 1,874
18k views

### Performance tuning in Mathematica?

What performance tuning tricks do you use to make a Mathematica application faster? MATLAB has an amazing profiler, but from what I can tell, Mathematica has no similar functionality.
• 2,409
8k views

### Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
• 34.1k
5k views

### Why does Mathematica use [[ ]] notation for array indexing?

I am confused by why Mathematica uses [[3]] to get the 3rd element, or [[i,j] to get the i,j-th element of a 2D array. This ...
5k views

• 181
1k views

### Dynamic Programming with delayed evaluation

By using dynamical programming, we can save intermediate steps for recursive relations, as in f[n_]:= f[n] = f[n-1] + f[n-2] However, this only stores ...
• 1,085
521 views

• 721