WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

ComplexityFunction

is an option for Simplify and other functions which gives a function to rank the complexity of different forms of an expression.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Properties & Relations  
See Also
Tech Notes
Related Guides
History
Cite this Page

ComplexityFunction

is an option for Simplify and other functions which gives a function to rank the complexity of different forms of an expression.

Details

  • With the default setting ComplexityFunction->Automatic , forms are ranked primarily according to their LeafCount , with corrections to treat integers with more digits as more complex.
  • Simplify [expr,ComplexityFunction->f] applies f to each intermediate expression generated by Simplify , treating the one which yields the smallest numerical value as simplest.

Examples

open all close all

Basic Examples  (2)

The default ComplexityFunction counts the subexpressions and digits of integers:

LeafCount counts only the number of subexpressions:

By default this expression is not simplified:

This complexity function makes ChebyshevT more expensive than other functions:

Scope  (1)

With the default ComplexityFunction , Abs [x] is simpler than the FullForm of -x:

This complexity function counts characters in the InputForm of the expression:

Now -x is simpler than Abs [x]:

Properties & Relations  (1)

The automatic complexity function:

Tech Notes

History

Introduced in 1996 (3.0)

Wolfram Research (1996), ComplexityFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ComplexityFunction.html.

Text

Wolfram Research (1996), ComplexityFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ComplexityFunction.html.

CMS

Wolfram Language. 1996. "ComplexityFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ComplexityFunction.html.

APA

Wolfram Language. (1996). ComplexityFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComplexityFunction.html

BibTeX

@misc{reference.wolfram_2025_complexityfunction, author="Wolfram Research", title="{ComplexityFunction}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ComplexityFunction.html}", note=[Accessed: 17-November-2025]}

BibLaTeX

@online{reference.wolfram_2025_complexityfunction, organization={Wolfram Research}, title={ComplexityFunction}, year={1996}, url={https://reference.wolfram.com/language/ref/ComplexityFunction.html}, note=[Accessed: 17-November-2025]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /