is an option for Compile that specifies runtime settings for the compiled function it creates.


  • RuntimeOptions applies to the execution of the compiled function.
  • RuntimeOptions can take the following overall settings:
  • "Quality"optimize for quality of final results
    "Speed"optimize for speed of getting results
  • RuntimeOptions can also take the following nested settings:
  • "CatchMachineOverflow"Falsewhether real overflow should be caught as it happens
    "CatchMachineIntegerOverflow"Truewhether integer overflow should be caught
    "CompareWithTolerance"Truewhether comparisons should work similarly to SameQ
    "EvaluateSymbolically"Truewhether to evaluate with symbolic arguments
    "RuntimeErrorHandler"Evaluatea function to apply if there is a fatal runtime error executing the function
    "WarningMessages"Truewhether warning messages should be emitted
  • RuntimeOptions->"Speed" is equivalent to the following nested settings:
  • "CatchMachineOverflow"False
  • RuntimeOptions->"Quality" is equivalent to the following nested settings:
  • "CatchMachineOverflow"True


open allclose all

Basic Examples  (1)

Typically, integer arithmetic overflow is caught and the computation switches to use bignums:

Turning off runtime checks leads to maximum speed but the result can be incorrect if the numbers overflow:

Options  (5)

CatchMachineIntegerOverflow  (1)

Typically, machine integer overflow is caught and generates a runtime error:

Turning off machine integer overflow checking leads to faster results, which may be incorrect in some cases:

RuntimeErrorHandler  (1)

The "RuntimeErrorHandler" setting is used when there is a runtime error:

With no error, the compiled function works as normal:

If there is a runtime error, the function behaves differently:

EvaluateSymbolically  (3)

The default is to evaluate the function symbolically with symbolic arguments:

With "EvaluateSymbolically"->False, the function returns unevaluated:

This evaluates if the symbolic argument is replaced with a number:

Sometimes symbolic evaluation does not give what you intend:

Preventing symbolic evaluation keeps the original intent:

Symbolic evaluation may be slow for expressions that expand out:

Wolfram Research (2010), RuntimeOptions, Wolfram Language function,


Wolfram Research (2010), RuntimeOptions, Wolfram Language function,


@misc{reference.wolfram_2020_runtimeoptions, author="Wolfram Research", title="{RuntimeOptions}", year="2010", howpublished="\url{}", note=[Accessed: 23-January-2021 ]}


@online{reference.wolfram_2020_runtimeoptions, organization={Wolfram Research}, title={RuntimeOptions}, year={2010}, url={}, note=[Accessed: 23-January-2021 ]}


Wolfram Language. 2010. "RuntimeOptions." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2010). RuntimeOptions. Wolfram Language & System Documentation Center. Retrieved from