|
|
|||
|
|
| Built-in Mathematica Symbol | Tutorials »|See Also »|More About » |
| TraceScan[f, expr] applies f to all expressions used in the evaluation of expr. |
| TraceScan[f, expr, form] includes only those expressions which match form. |
| TraceScan[f, expr, s] includes all evaluations which use transformation rules associated with the symbol s. |
| TraceScan[f, expr, form, fp] applies f before evaluation and fp after evaluation to expressions used in the evaluation of expr. |
Print all expressions used for evaluation: Count additions and multiplications of machine numbers needed for a numerical computation:
A recursive definition for finding Fibonacci numbers:
Count calls to fib required:
Redefine fib so that it saves results:
Count calls to fib required:
The second time through it takes only one call since the value was saved:
|
| © 2013 Wolfram Research, Inc. |