Groups | Search | Server Info | Login | Register


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

How to avoid repeated recalculation of the same function

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From pgeipi10@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject How to avoid repeated recalculation of the same function
Date Fri, 2 May 2014 06:18:56 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <ljvdcg$bal$1@smc.vnet.net> (permalink)
Lines 15
Organization Time-Warner Telecom
NNTP-Posting-Date 02 May 2014 06:25:10 GMT
NNTP-Posting-Host bfa68086.news.twtelecom.net
X-Trace DXC=c>0>gB6Q8ZVaZ\a6[n:\J_C_A=>8kQj6];[h;PUXBgbTHnHVmV3ecQTEFiONJ7[GoV<VTF<6LMVLZ
X-Complaints-To abuse@twtelecom.net
Xref csiph.com comp.soft-sys.math.mathematica:16882

Show key headers only | View raw


Hi,

I'm doing a calculaton that's purly symbolic (no graphing, numerical integration, etc.).

Suppose I have a function f[x_]:=... that's very complex to build. In fact, f[x] ends up being a manageable expression (about 30 characters) but it takes Mathematica about 30 min to build that expression.

Another function g[] uses the function f[x] and references it many times. I've discovered that g[] actually builds f[x] every time it's referenced which takes 30 minutes each time. Theoretically, Mathematica could build it once and then use the resulting expression every time it's referenced.

So how do I accomplish that? That is, how do I make it build f[x] once and then use the resulting expression when it's needed?

Thanks,


Pavel

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar


Thread

How to avoid repeated recalculation of the same function pgeipi10@gmail.com - 2014-05-02 06:18 +0000
  Re: How to avoid repeated recalculation of the same function Richard Fateman <fateman@cs.berkeley.edu> - 2014-05-03 07:39 +0000
  Re: How to avoid repeated recalculation of the same function Joe Gwinn <joegwinn@comcast.net> - 2014-05-03 07:40 +0000
  Re: How to avoid repeated recalculation of the same function psycho_dad <s.nesseris@gmail.com> - 2014-05-04 06:27 +0000
  Re: How to avoid repeated recalculation of the same function Roland Franzius <roland.franzius@uos.de> - 2014-05-04 06:28 +0000

csiph-web