MathGroup Archive 1999

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

Search the Archive

RE: speed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15625] RE: [mg15593] speed
  • From: "Jean-Marie THOMAS" <jmthomas at agat.net>
  • Date: Sat, 30 Jan 1999 04:28:27 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Note first that programming with Nest is faster than a do loop and
second I doubt working in machine precision gives you the same results!


Timing[x=0.3;Print[x]; Do[x=x*1.003456,{i,1,1000000}];Print[x]] 0.3`
6.47467770894613173679`10.1231*^1497 {179.94799999999989` Second,Null}
Timing[x=0.3;Print[x];Nest[# 1.003456&,x,1000000]] 0.3`
{160.210999999999792` Second,6.47467770894613173679`10.1231*^1497}

Hope this helps,


**************************************** Jean-Marie THOMAS
mailto:jmthomas at agat.net
Conseil et Audit en Ingenierie de Calcul Strasbourg, France
http://www.agat.net
****************************************

-----Original Message-----
From: Margit [mailto:mgfoehle at mch1srv.tuwien.ac.at] To:
mathgroup at smc.vnet.net
Subject: [mg15625] [mg15593] speed


Hi!

I have a question concerning the numerical speed of Mathematica:

I performed the following calculation

x=0.3;Print[x]; Do[x=x*1.003456,{i,1,1000000}];Print[x]

with Mathematica, it took about 150 seconds.

The same calculation is performed by TurboPascal in 0.4 seconds.

I guess that the difference is caused by the working precision. Does
anyone know what is the reason for this long duration and how it can be
changed?

Thanks!

Margit



  • Prev by Date: Re: Next Version of Mathematica?
  • Next by Date: Transc. Eqn - Symb. Iterative Sol'n.?
  • Previous by thread: Re: speed
  • Next by thread: Re: speed