MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

For loop problem in mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90163] For loop problem in mathematica
  • From: PhysNova <skhoshbinfar at gmail.com>
  • Date: Tue, 1 Jul 2008 06:59:02 -0400 (EDT)

Hi,
i wrote a simple program of evaluating Pi number in M6 to test cpu
computation timing, to do this a simple for loop

was used:

x=0;For[i = 1, i < 10,000,000, i++, x = x + 1/(i^2)];N[Sqrt(6*x),25]//
Timing

the result was catastrophe! it take few minuates. but i first expect
to do this very simple job in few

seconds.computation time is just satisfactory up to 100000 cycle.

could anyone interperet this falut?
our get an idea to improve the result?

Tanks


  • Prev by Date: not eliminating parameter
  • Next by Date: Re: How to find out which line the error refers to?
  • Previous by thread: Re: not eliminating parameter
  • Next by thread: Re: For loop problem in mathematica