Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8682

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

From Tomas Garza <tgarza10@msn.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How I can I optimize the following code in order to
Date 2012-02-22 10:31 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ji2g6e$k9d$1@smc.vnet.net> (permalink)
References <201202211109.GAA08132@smc.vnet.net>

Show all headers | View raw


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@gmail.com
> Subject: How I can I optimize the following code in order to get very short running time
> To: mathgroup@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];
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: How I can I optimize the following code in order to Tomas Garza <tgarza10@msn.com> - 2012-02-22 10:31 +0000

csiph-web