MathGroup Archive 2005

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

Search the Archive

Re: compile / optimize


Hi,

ff = Experimental`OptimizeExpression[
Module[{x = 0}, Do[x += Sin[t^2]/(1 + x), {12}]; x]]


myfun=Compile[{{t, _Real}}, Evaluate[ff]]

??

Regards

  Jens



"Frank Brand" <frank.brand at t-online.de> schrieb im Newsbeitrag 
news:csl1pm$6ve$1 at smc.vnet.net...
> Dear mathgroup members,
>
> can anybody give me an advice how to generally
>
> 1.optimize (using the optimization package "optimize.m") and after that
> 2. compile pieces of code like
>
> Module[{t}, t = x; Do[t = (t + x/t)/2, {n}]; t]
>
> Applying the two-step approach to the code above with a given n (=15)
> there is a speed up ratio of 8500 compared with the original exprssion.
>
> Is it possible to apply this procedure to general expressions?
>
> Thanks in advance
> Frank
> 



  • Prev by Date: Re: A NewBie Question
  • Next by Date: Re: A NewBie Question
  • Previous by thread: compile / optimize
  • Next by thread: Re: compile / optimize