Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

My main fear is living forever.

I'm not very good with C/C++ (I think it's one of those) but wouldn't this:

```
double xSquared = x*x; // compute x squared ahead of time
double sum = x; // add the first term to the accumulated sum
double previousTerm = x;
for (int n = 3; n < INFINITY; n+= 2) // continue on from the second term
{
// compute this term using the previous term
previousTerm = -previousTerm*xSquared/( (n*(n-1));
sum += previousTerm;
}
return sum;
```

Be a little quicker?

Pages: **1**