# Tag Info

### How can I adaptively simplify a curved shape?

We can use the Ramer-Douglas-Peucker algorithm to reduce the number of points. This algorithm was originally devised for processing map data. ...
• 236k

### Series sum approximation

Writing: NSum[(-1)^n/Sqrt[Log[n]], {n, 2, Infinity}, Method -> "AlternatingSigns"] I get: 0.690243 which is what you want. In particular, directly from ...
• 4,452

### Chebyshev Approximation

Here's a way to leverage the Clenshaw-Curtis rule of NIntegrate and Anton Antonov's answer, Determining which rule NIntegrate selects automatically, to construct a ...
• 238k

### François Viète's approximation to π

You could use VietePiApprox[n_] := (Times @@ NestList[Sqrt[2 + #] &, Sqrt[2], n])/ 2^(n + 1) SetAttributes[VietePiApprox, Listable] which approximates Pi as ...
• 15.3k

### How can I get samples of f(x) that are roughly evenly spaced?

f[x_] := 1 - 8 x^2 + 8 x^4; You can use the option MeshFunctions -> {ArcLength} and ... 1. Specify the number of equal-arc-...
• 398k
Accepted

### Approximating for $a \gg b$

How about this: Normal@Series[1/((a + b) b), {a, Infinity, 1}] (* ==> 1/(a b) *) Normal@Series[ArcTan[a + b], {a, Infinity, 1}] (* ==> -(1/a) + Pi/2 *) ...
• 97.5k

### Continued fraction approximation for $\pi$

1 + ContinuedFractionK[(2 n - 1)^2, 2, {n, 1, Infinity}] (* 4/π *) Pick a termination point less than Infinity to get an ...
• 238k

### How can I get samples of f(x) that are roughly evenly spaced?

If we want to the ArcLength approximately equal to the dist = 0.15;, we can define an arclength function ...
• 76.9k

### Approximation with radial basis functions

Introduction Radial basis function approximation has the form $$f(x) \approx \sum_{j=1}^N c_j \phi(\| x-x_j\|)$$ for some function $\phi(r)$ such as a Gaussian. Solving for the coefficients $c_j$ is ...
• 238k

### How can I adaptively simplify a curved shape?

Here is my attempt to use ParametricPlot for obtaining an adaptive approximation of the shape. It is based on the code of glyph to ...

### How can I adaptively simplify a curved shape?

Here I present a very simple angle-based polygon reduction algorithm as described in the chapter "A Simple Algorithm" of David Eberly's "Polyline Reduction". The only addition is ...

### Approximation with radial basis functions

Here is an answer with LinearModelFit using the data in the example referenced in the question. Data: ...
• 37.9k
Accepted

### Why this weird return value from N?

As @t-smart seems to suspect, the change in V11.3 to let machine underflows to underflow to 0. is at the root of this bug. In the OP's problem, Mathematica ...
• 238k
Accepted

### Calculating relative error of Ramanujan formula for ellipse perimeter

We have to express a parameter $h=(a-b)^2/(a+b)^2$ in terms of the eccentricity of the ellipse $e = \sqrt{1-b^2/a^2}$. Similarly we need comparing the second Ramanujan approximation for the ...
• 57.5k

### Analytical approximation of indefinite integral on a given interval to a given precision

One can construct a Chebyshev series approximation to the integrand for an interval, such as -5 <= x <=5 mentioned in the comments, and integrate it to get a ...
• 238k

### François Viète's approximation to π

Well, FoldList also can finish this job: 2/Times @@ (1/2 FoldList[Sqrt[2 + #] &, ConstantArray[Sqrt[2.], 10]]) By the way,...
• 9,823
Accepted

### How to find a numerical antiderivative with NIntegrate methods?

We construct an NDSolve method which can pass an NIntegrate method to NIntegrate to set up ...
• 238k

### Making algebraic substitutions with approximations

You could use Series[c/(a^2 - a*b), {a, Infinity, 4}] which yields
• 11.9k

### Series sum approximation

Using identity: $$\int_0^{\infty } \frac{2 n^{-t^2}}{\sqrt{\pi }} \, dt=\frac{1}{\sqrt{\log (n)}}$$ then I have: \sum _{n=2}^{\infty } \frac{(-1)^n}{\sqrt{\log (n)}}=\\\sum _{n=2}^{\infty } (-1)^n \...
• 14.3k
Accepted

### Extracting a function from a Contour Plot

What you may not know is that the notebook interface is a bit like a web browser. Whatever complicated interface the web browser is showing, you can always just right-click and show the HTML source ...
• 70.8k
Accepted

### How to approximate $PV\int_0^\infty \frac{\tan x}{x}\text{d}x?$

The integral is Pi/2, a proof of which may be found on math.SE. Here's a numerical check, integrating $(\tan z)/z$ over parallel paths $z = x \pm a i$ and ...
• 238k
Accepted

### Suggest an irrational number from decimal one

Try WolframAlpha guess[x_]:=WolframAlpha["identify "<>ToString@x]
• 9,988
Accepted

### Approximation in LinePlot from NIntegrate

Exclude the poles. And do not need Quite anymore also. V 13.2 on windows. Basically you have an improper integral due to discontinuity at $x=1$ ...
• 146k

...
• 48.3k

### Finding out the closest approximation of a decimal number by a ratio of two integers

Here is a brute-force version of bobby's answer: Table[First[MinimalBy[FareySequence[k], Abs[0.647437 - #] &]], {k, {5, 20, 1000}}] ...
Accepted

### Fail to make good approximation with a Taylor Series

Perhaps this? PadeApproximant[-((-1 + m)^2/(-1 + 2 m - m^2 - 4 m Ne + 2 m^2 Ne)), {m, 0, {0, 1}}] (* 1/(1 + 4 m Ne) *) Note: A Taylor series is a power series, ...
• 238k

### Replace product of variables to zero

I would use an algebraic function for an algebraic operation, similar to what I did in the similar question, Replacement rules and algebra: ...
• 238k

### Continued fraction approximation for $\pi$

Michael's method of using ContinuedFractionK[] is the canonical way. If you want to look at the forward recursion method manually, you can use repeated matrix ...
Accepted

### Series function not expanding an expression

V 12.1.1. Just add FullSimplify to help it ...
• 146k