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
    "CatchMachineUnderflow"Falsewhether real underflow 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

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

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

Click for copyable input

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

Click for copyable input
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »