MATHEMATICA MESSAGE

CompiledFunction::cfex

DetailsDetails

  • This message is generated when the compiler calls external (uncompiled) evaluation to compute the value of an expression and the result does not have the expected form.
  • This message will often be preceded by other messages that provide additional details about the error.
  • External evaluation is evaluation that is done outside of the compiler.
  • External evaluation is used for expressions that are not recognized by the compiler, such as symbolic global variables.
  • The instruction referred to in the warning message can be found in the fourth argument of the CompiledFunction expression. This instruction will always correspond to external evaluation. It is sometimes possible to determine the cause of the error by looking at the arguments of this instruction.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[CompiledFunction::cfex].

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

The global variable in the CompiledFunction expression should evaluate to a real number:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Compiled evaluation proceeds if the result of external evaluation is a real number:

In[3]:=
Click for copyable input
Out[3]=

The instruction that led to the error can be obtained from the CompiledFunction expression:

In[4]:=
Click for copyable input
Out[4]=

Clear the value of cf.

In[5]:=
Click for copyable input
New to Mathematica? Find your learning path »
Have a question? Ask support »