TraceEvaluation


TraceEvaluation[expr, options]

Evaluate expr and print each step of the evaluation.

Options adjust output and filtering behavior


ShowTimeBySteps

Print the elapsed time before an evaluation occurs. default is False.

ShowEvaluation

Show evaluation calls and returns. The default is True.

ShowRewrite

Show the effect of rewrite rules. The default is True.

Note: It does not make sense to set both ShowRewrite and ShowEvaluation to False.

Now consider this function which consists of a function call that involves a rewrite rule:

Sometimes, TraceEvaluation traces can get quite large. To reduce the size, it may be helpful to filter on either the evaluations or the replacement rules.

To see just the evaluations and return values, but not rewrite that occurs:

To see just the rewrite that occurs, which tends to summarizes even more:

TraceBuiltins