MathGroup Archive 2012

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

Search the Archive

Re: How I can I optimize the following code in order to

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125113] Re: How I can I optimize the following code in order to
  • From: Tomas Garza <tgarza10 at msn.com>
  • Date: Wed, 22 Feb 2012 05:30:28 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201202211109.GAA08132@smc.vnet.net>

Is this really supposed to do anything, other than calculating 9,000,000 times the same thing, i.e.,
Sin (45.0)*ArcSin (0.5)*Sqrt (5.0)*ArcTan (2.5555), a task which takes 46 seconds in my PC (using the right syntax)? To obtain x in a very short time you just have to calculate it only once...
-Tomas

> Date: Tue, 21 Feb 2012 06:09:34 -0500
> From: gearss8888 at gmail.com
> Subject: How I can I optimize the following code in order to get very short running time
> To: mathgroup at smc.vnet.net
>
> How I can I optimize the following code in order to get very short
> running time?
>
> Time1 = AbsoluteTime[];
> n = 3000;
> Do[Do[x =
>      Sin (45.0)*ArcSin (0.5)*Sqrt (5.0)*ArcTan (2.5555);, {n}], {n}];
> Time2 = AbsoluteTime[];
> Print[Time2 - Time1];
>


  • Prev by Date: Re: How I can I optimize the following code in order to
  • Next by Date: Retrieving numerical value for ImagePadding
  • Previous by thread: Re: How I can I optimize the following code in order to
  • Next by thread: Re: How I can I optimize the following code in order to get very short running time