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

You are not logged in.

#1 Re: This is Cool » Will this plane take off? » 2008-01-27 09:14:14

I think it would get airborne. Seen as it's not the wheels that drive it, it's the jet engines. So it's still going to be 'pushed' along at the same rate, no matter how quick the treadmill is moving.

#3 Re: Coder's Corner » super fast trig functions » 2007-12-12 08:01:06

I think in most computers they have tables like how ricky did it. The only difference being they can access the table quicker as it's part of the CPU, not stored in memory.

#4 Re: Coder's Corner » super fast trig functions » 2007-12-12 05:28:01

This is only small but I think computers execute ((n^2)-n) quicker than (n*(n-1)). As I said in the last post though I'm not very good in C/C++ so this could be wrong. It might not be worth the hassle of changing and testing as it would only be a very very small gain in speed, if any.

#5 Re: Coder's Corner » super fast trig functions » 2007-12-12 04:20:50

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?

Board footer

Powered by FluxBB