```Andrzej Kozlowski wrote:
> CoplexityFunction in the past, and knowing it really wont help you much:
>
>
> SimplifyCount[p_] :=
>    If[IntegerQ[p],
>       If[p==0, 1, Floor[N[Log[2, Abs[p]]/Log[2, 10]]]+If[p>0, 1,
> 2]],
>          SimplifyCount[Numerator[p]]+SimplifyCount[Denominator[p]]+1,
>             SimplifyCount[Re[p]]+SimplifyCount[Im[p]]+1,
>             If[NumberQ[p], 2,
> 	       Plus@@(SimplifyCount/@(List@@p))]]]]]]
>
> Would it be helpful to have this in the Documentation?

It would be more helpful if it were more readable, that's for sure.

I think Adam's function is equivalent to

SimplifyCount[0]=1
SimplifyCount[_Symbol]:=1
SimplifyCount[p_Integer]:= Floor[N[Log[2, Abs[p]]/Log[2, 10]]]+If[p>0, 1, 2]
SimplifyCount[p_Rational]:=
SimplifyCount[Numerator[p]]+SimplifyCount[Denominator[p]]+1,
SimplifyCount[p_Complex]:= SimplifyCount[Re[p]]+SimplifyCount[Im[p]]+1,
SimplifyCount[p_?NumberQ]:= 2
(*everything else*)

not tested, but you get the idea.  Adam's program may be faster in some
way, or he may have written because he thinks in terms of If[Head[]==]
and it did not occur to him to use pattern matching. Or maybe my program
doesn't work because the interactions of the multiple patterns cause
problems -- I require that the patterns be applied in the right order
and Mathematica may be randomizing them in some way. (That is, 0 is an
Integer, but we want to use the first line, not the 3rd).

One way to make documentation readable is to have a system that is
logically consistent --- the semantics are simpler. By this measure, it
would be much easier to understand the system and read this
documentation if the pattern matching for p/q and r+s*I did not need
special cases when p and q , or s were numbers, but just
looked like the same patterns as the cases when p,q, s are symbols.
Then the complexity function would look like this

SimplifyCount[0]=1
SimplifyCount[_Symbol]:=1
SimplifyCount[p_Integer]:= Floor[N[Log[2,Abs[p]]/Log[2,10]]]+If[p>0,1,2]
SimplifyCount[p_?NumberQ]:= 2