({{, (RefLink[CompiledFunction, paclet:ref/CompiledFunction])[args…]
represents compiled code for evaluating a compiled function. }})

OpenersNotesSection(Spacer1)Details

(RefLink[Compile, paclet:ref/Compile]) generates a (RefLink[CompiledFunction, paclet:ref/CompiledFunction]) object that can be executed by applying it to appropriate arguments.

(RefLink[CompiledFunction, paclet:ref/CompiledFunction]) objects that are constructed explicitly can also be executed. Basic consistency checks are done when such objects are first evaluated by the Wolfram Language.

The code in a (RefLink[CompiledFunction, paclet:ref/CompiledFunction]) object is based on an idealized register machine.

A (RefLink[CompiledFunction, paclet:ref/CompiledFunction]) object can additionally refer to natively compiled code.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

(RefLink[CompiledFunction, paclet:ref/CompiledFunction]) objects are generated by (RefLink[Compile, paclet:ref/Compile]):

{f,cf}={Function[{x,y},Sqrt[x y]],Compile[{x,y},Sqrt[x y]]}

(RefLink[CompiledFunction, paclet:ref/CompiledFunction]) objects can be used as normal (RefLink[Function, paclet:ref/Function]) objects:

{f[1.,2.],cf[1.,2.]}

Arguments are coerced, if possible, to be approximate real:

{f[1,2],cf[1,2]}

When exceptional values are encountered, the uncompiled function is used:

{f[-1,2.],cf[-1,2.]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Compile, paclet:ref/Compile])  ▪  (RefLink[Function, paclet:ref/Function])  ▪  (RefLink[InterpolatingFunction, paclet:ref/InterpolatingFunction])  ▪  (RefLink[CompilationTarget, paclet:ref/CompilationTarget])  ▪  (RefLink[Parallelization, paclet:ref/Parallelization])  ▪  (RefLink[RuntimeAttributes, paclet:ref/RuntimeAttributes])  ▪  (RefLink[RuntimeOptions, paclet:ref/RuntimeOptions])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Expressions with Heads That Are Not Symbols, paclet:tutorial/ExpressionsWithHeadsThatAreNotSymbols])}, {▪(RefLinkPlain[Compiling Wolfram Language Expressions, paclet:tutorial/CompilingWolframLanguageExpressions])}, {▪(RefLinkPlain[The Wolfram Language Compiler User Guide, paclet:Compile/tutorial/Overview])}, {▪(RefLinkPlain[C Code Generation User Guide, paclet:CCodeGenerator/tutorial/Overview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Code Compilation, paclet:guide/CodeCompilation])}})}})