Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

[Mathematica] Newbie with Compile[]

  1. Nov 18, 2011 #1
    Hello all :)

    I'm just beginning trying to use compiled version of several simple functions. And right at the beginning, I stumble onto a “Numerical error” error message which puzzle me…

    Here is my simple code :

    Code (Text):
    11/18/11 12:51:07 In[18]:= \[Epsilon]IntrinsicSiliciumC =
      Compile[{{\[Omega], _Real}, {L, _Real}},
       Module[{\[Omega]0, \[Epsilon]0, \[Epsilon]Inf, c = 299792458},
        \[Omega]0 = (66 10^14)/(c (10^9) ) L;
        \[Epsilon]0 = 11.87;
        \[Epsilon]Inf = 1.035;
        \[Epsilon]Inf + ((\[Epsilon]0 - \[Epsilon]Inf) \[Omega]0^2)/(\
    \[Omega]^2 + \[Omega]0^2)
       , CompilationTarget -> "C"];

    11/18/11 13:05:18 In[23]:= \[Epsilon]IntrinsicSiliciumC[1., 1.]

    11/18/11 13:05:19 During evaluation of In[23]:= CompiledFunction::cfne: Numerical error encountered; proceeding with uncompiled evaluation. >>

    11/18/11 13:05:19 Out[23]= 1.0402
    Basically, how to debug such error message (which is quite vague…)

    Thanks in advance :)
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted