Re: Re: Strange behavior of Simplify
- To: mathgroup at smc.vnet.net
- Subject: [mg40180] Re: Re: Strange behavior of Simplify
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Tue, 25 Mar 2003 03:04:06 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Thanks, Bob. This is actually a good example to illustrate the
ComplexityFunction option.
expr = Exp[2*n^2*(Log[1 + t] - Log[1 - t])];
LeafCount[expr]
20
newexpr = (1 + t)^(2*n^2)/(1 - t)^(2*n^2);
LeafCount[newexpr]
21
So with the default ComplexityFunction->LeafCount, expr is already
"simpler" than "newexpr". However...
Depth[expr]
8
Depth[newexpr]
5
So with ComplexityFunction->Depth, newexpr is "simpler" than expr;
thus...
Simplify[expr, ComplexityFunction->Depth]
(1 + t)^(2*n^2)/(1 - t)^(2*n^2)
Very cool!
On Monday, March 24, 2003, at 04:28 AM, Bob Hanlon wrote:
> $Version
>
> 4.2 for Mac OS X (August 22, 2002)
>
> expr = Exp[2*n^2*(Log[1 + t] - Log[1 - t])];
>
> expr // ExpandAll // Simplify
>
> (1 + t)^(2*n^2)/(1 - t)^(2*n^2)
>
> FullSimplify[expr, ComplexityFunction -> Length]
>
> (1 + t)^(2*n^2)/(1 - t)^(2*n^2)
>
>
> Bob Hanlon
>
> In article <b5jtgf$mah$1 at smc.vnet.net>, Selwyn Hollis
> <selwynh at earthlink.net>
> wrote:
>
> << Subject: Strange behavior of Simplify
> From: Selwyn Hollis <selwynh at earthlink.net>
To: mathgroup at smc.vnet.net
> To: mathgroup at smc.vnet.net
> Date: Sun, 23 Mar 2003 09:07:27 +0000 (UTC)
>
> I've just run across the following strange behavior of Simplify.
> (Using Mathematica 4.1.5, Mac OS X).
>
> These first two commands work as expected:
>
> Simplify[Exp[2*n*(Log[1 + t] - Log[1 - t])]]
>
> (1 - t)^(-2*n) (1 + t)^(2*n)
>
> Simplify[Exp[n^2*(Log[1 + t] - Log[1 - t])]]
>
> (1 - t)^(-n^2) (1 + t)^(n^2)
>
> But Simplify refuses to do anything with this:
>
> Simplify[Exp[2*n^2*(Log[1 + t] - Log[1 - t])]]
>
> Exp[2*n^2*(Log[1 + t] - Log[1 - t])]
>
> Can anyone shed some light here? By the way, FullSimplify does the
> same thing. >><BR><BR>
>