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


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

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

From Murray Eisenberg <murray@math.umass.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How I can I optimize the following code in order to
Date 2012-02-22 10:35 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ji2gd7$kc5$1@smc.vnet.net> (permalink)
References <201202211109.GAA08132@smc.vnet.net>

Show all headers | View raw


I don't see the point of evaluating exactly the same expression 3000^2 
times.

On 2/21/12 6:09 AM, Liwen Zhang wrote:
> 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];
>

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

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 Murray Eisenberg <murray@math.umass.edu> - 2012-02-22 10:35 +0000

csiph-web