MathGroup Archive 2003

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

Search the Archive

Re: Compile

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45228] Re: Compile
  • From: Maxim <dontsendhere@.>
  • Date: Sun, 21 Dec 2003 03:42:20 -0500 (EST)
  • References: <brplr9$7tf$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Probably unrelated, but consider

In[1]:=
Module[{subs = x -> x^2},
  Plot[x /. subs, {x, 0, 1}, Compiled -> True]
]
Module[{subs = x -> x^2},
  Plot[x /. subs, {x, 0, 1}, Compiled -> False]
]

(straight line with the default setting of Compiled->True and parabola with
Compiled->False). Or

In[3]:=
Module[{y := If[NumericQ[x], x, 1]},
  Plot[x y, {x, 0, 1}, Compiled -> True]
]
Module[{y := If[NumericQ[x], x, 1]},
  Plot[x y, {x, 0, 1}, Compiled -> False]
]

(same, straight line in the first case and parabola in the second). The question is
probably what exactly Mathematica tries to wrap in Compile and how it then deals with
'external' expressions depending on the iterator variable.

In any case it seems that we have yet another untransparent internal transformation that
leaves us guessing about the result.

Maxim Rytin
m.r at prontomail.com



  • Prev by Date: Re: a bug in RealDigits? Mathematica 5.0
  • Next by Date: Re: Power Series for LogIntegral
  • Previous by thread: RE: Re: Compile
  • Next by thread: Re: Re: Compile